langscan 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. data/AUTHORS.txt +19 -0
  2. data/History.txt +126 -0
  3. data/Manifest.txt +167 -0
  4. data/README.rdoc +89 -0
  5. data/Rakefile +40 -0
  6. data/ext/langscan/_make_c.rb +20 -0
  7. data/ext/langscan/_make_h.rb +30 -0
  8. data/ext/langscan/_template.c +134 -0
  9. data/ext/langscan/_template.h +53 -0
  10. data/ext/langscan/c/c/Makefile +157 -0
  11. data/ext/langscan/c/c/c.c +134 -0
  12. data/ext/langscan/c/c/c.h +66 -0
  13. data/ext/langscan/c/c/ctok.c +4622 -0
  14. data/ext/langscan/c/c/ctok.l +212 -0
  15. data/ext/langscan/c/c/extconf.rb +3 -0
  16. data/ext/langscan/c/c/modulename.txt +1 -0
  17. data/ext/langscan/c/c/tokenlist.txt +13 -0
  18. data/ext/langscan/csharp/csharp/Makefile +157 -0
  19. data/ext/langscan/csharp/csharp/csharp.c +134 -0
  20. data/ext/langscan/csharp/csharp/csharp.h +65 -0
  21. data/ext/langscan/csharp/csharp/csharptok.c +2965 -0
  22. data/ext/langscan/csharp/csharp/csharptok.l +200 -0
  23. data/ext/langscan/csharp/csharp/extconf.rb +3 -0
  24. data/ext/langscan/csharp/csharp/modulename.txt +1 -0
  25. data/ext/langscan/csharp/csharp/tokenlist.txt +12 -0
  26. data/ext/langscan/d/d/Makefile +157 -0
  27. data/ext/langscan/d/d/d.c +134 -0
  28. data/ext/langscan/d/d/d.h +64 -0
  29. data/ext/langscan/d/d/dtok.c +5461 -0
  30. data/ext/langscan/d/d/dtok.l +282 -0
  31. data/ext/langscan/d/d/extconf.rb +3 -0
  32. data/ext/langscan/d/d/modulename.txt +1 -0
  33. data/ext/langscan/d/d/tokenlist.txt +11 -0
  34. data/ext/langscan/elisp/elisp/Makefile +157 -0
  35. data/ext/langscan/elisp/elisp/elisp.c +134 -0
  36. data/ext/langscan/elisp/elisp/elisp.h +62 -0
  37. data/ext/langscan/elisp/elisp/elisptok.c +2101 -0
  38. data/ext/langscan/elisp/elisp/elisptok.l +151 -0
  39. data/ext/langscan/elisp/elisp/extconf.rb +3 -0
  40. data/ext/langscan/elisp/elisp/modulename.txt +1 -0
  41. data/ext/langscan/elisp/elisp/tokenlist.txt +9 -0
  42. data/ext/langscan/java/java/Makefile +157 -0
  43. data/ext/langscan/java/java/extconf.rb +3 -0
  44. data/ext/langscan/java/java/java.c +134 -0
  45. data/ext/langscan/java/java/java.h +64 -0
  46. data/ext/langscan/java/java/javatok.c +2090 -0
  47. data/ext/langscan/java/java/javatok.l +155 -0
  48. data/ext/langscan/java/java/modulename.txt +1 -0
  49. data/ext/langscan/java/java/tokenlist.txt +11 -0
  50. data/ext/langscan/javascript/javascript/Makefile +157 -0
  51. data/ext/langscan/javascript/javascript/extconf.rb +3 -0
  52. data/ext/langscan/javascript/javascript/javascript.c +134 -0
  53. data/ext/langscan/javascript/javascript/javascript.h +63 -0
  54. data/ext/langscan/javascript/javascript/javascripttok.c +2051 -0
  55. data/ext/langscan/javascript/javascript/javascripttok.l +147 -0
  56. data/ext/langscan/javascript/javascript/modulename.txt +1 -0
  57. data/ext/langscan/javascript/javascript/tokenlist.txt +10 -0
  58. data/ext/langscan/pairmatcher/pairmatcher/Makefile +157 -0
  59. data/ext/langscan/pairmatcher/pairmatcher/extconf.rb +3 -0
  60. data/ext/langscan/pairmatcher/pairmatcher/pairmatcher.c +890 -0
  61. data/ext/langscan/php/php/Makefile +157 -0
  62. data/ext/langscan/php/php/extconf.rb +3 -0
  63. data/ext/langscan/php/php/modulename.txt +1 -0
  64. data/ext/langscan/php/php/php.c +134 -0
  65. data/ext/langscan/php/php/php.h +64 -0
  66. data/ext/langscan/php/php/phptok.c +2406 -0
  67. data/ext/langscan/php/php/phptok.l +212 -0
  68. data/ext/langscan/php/php/tokenlist.txt +11 -0
  69. data/ext/langscan/post-distclean.rb +21 -0
  70. data/ext/langscan/pre-config.rb +57 -0
  71. data/ext/langscan/python/python/Makefile +157 -0
  72. data/ext/langscan/python/python/extconf.rb +3 -0
  73. data/ext/langscan/python/python/modulename.txt +1 -0
  74. data/ext/langscan/python/python/python.c +134 -0
  75. data/ext/langscan/python/python/python.h +61 -0
  76. data/ext/langscan/python/python/pythontok.c +2102 -0
  77. data/ext/langscan/python/python/pythontok.l +155 -0
  78. data/ext/langscan/python/python/tokenlist.txt +8 -0
  79. data/ext/langscan/ruby/compat/ripper/Makefile +158 -0
  80. data/ext/langscan/ruby/compat/ripper/depend +1 -0
  81. data/ext/langscan/ruby/compat/ripper/extconf.rb +4 -0
  82. data/ext/langscan/ruby/compat/ripper/include/eventids1.c +251 -0
  83. data/ext/langscan/ruby/compat/ripper/include/eventids2.c +277 -0
  84. data/ext/langscan/ruby/compat/ripper/include/lex.c +138 -0
  85. data/ext/langscan/ruby/compat/ripper/ripper.c +14420 -0
  86. data/ext/langscan/scheme/scheme/Makefile +157 -0
  87. data/ext/langscan/scheme/scheme/extconf.rb +3 -0
  88. data/ext/langscan/scheme/scheme/modulename.txt +1 -0
  89. data/ext/langscan/scheme/scheme/scheme.c +134 -0
  90. data/ext/langscan/scheme/scheme/scheme.h +60 -0
  91. data/ext/langscan/scheme/scheme/schemetok.c +2447 -0
  92. data/ext/langscan/scheme/scheme/schemetok.l +177 -0
  93. data/ext/langscan/scheme/scheme/tokenlist.txt +7 -0
  94. data/ext/langscan/sh/sh/Makefile +157 -0
  95. data/ext/langscan/sh/sh/extconf.rb +3 -0
  96. data/ext/langscan/sh/sh/modulename.txt +1 -0
  97. data/ext/langscan/sh/sh/sh.c +134 -0
  98. data/ext/langscan/sh/sh/sh.h +61 -0
  99. data/ext/langscan/sh/sh/shtok.c +2470 -0
  100. data/ext/langscan/sh/sh/shtok.l +325 -0
  101. data/ext/langscan/sh/sh/tokenlist.txt +8 -0
  102. data/lib/langscan.rb +124 -0
  103. data/lib/langscan/_common.rb +50 -0
  104. data/lib/langscan/_easyscanner.rb +78 -0
  105. data/lib/langscan/_pairmatcher.rb +46 -0
  106. data/lib/langscan/_type.rb +125 -0
  107. data/lib/langscan/autoconf.rb +51 -0
  108. data/lib/langscan/automake.rb +51 -0
  109. data/lib/langscan/brainfuck.rb +48 -0
  110. data/lib/langscan/c.rb +144 -0
  111. data/lib/langscan/csharp.rb +101 -0
  112. data/lib/langscan/css.rb +109 -0
  113. data/lib/langscan/d.rb +201 -0
  114. data/lib/langscan/eiffel.rb +167 -0
  115. data/lib/langscan/elisp.rb +132 -0
  116. data/lib/langscan/io.rb +84 -0
  117. data/lib/langscan/java.rb +95 -0
  118. data/lib/langscan/javascript.rb +97 -0
  119. data/lib/langscan/lua.rb +116 -0
  120. data/lib/langscan/ocaml.rb +298 -0
  121. data/lib/langscan/ocaml/camlexer.ml +28 -0
  122. data/lib/langscan/ocaml/lexer.mll +230 -0
  123. data/lib/langscan/ocaml/types.ml +36 -0
  124. data/lib/langscan/perl.rb +87 -0
  125. data/lib/langscan/perl/tokenizer.pl +231 -0
  126. data/lib/langscan/php.rb +80 -0
  127. data/lib/langscan/python.rb +101 -0
  128. data/lib/langscan/rpmspec.rb +71 -0
  129. data/lib/langscan/ruby.rb +164 -0
  130. data/lib/langscan/ruby/compat/README +5 -0
  131. data/lib/langscan/ruby/compat/ripper.rb +4 -0
  132. data/lib/langscan/ruby/compat/ripper/core.rb +918 -0
  133. data/lib/langscan/ruby/compat/ripper/filter.rb +70 -0
  134. data/lib/langscan/ruby/compat/ripper/lexer.rb +179 -0
  135. data/lib/langscan/ruby/compat/ripper/sexp.rb +100 -0
  136. data/lib/langscan/scheme.rb +160 -0
  137. data/lib/langscan/sh.rb +116 -0
  138. data/lib/langscan/text.rb +37 -0
  139. data/metaconfig +2 -0
  140. data/script/console +10 -0
  141. data/script/destroy +14 -0
  142. data/script/generate +14 -0
  143. data/script/makemanifest.rb +21 -0
  144. data/setup.rb +1604 -0
  145. data/tasks/extconf.rake +13 -0
  146. data/tasks/extconf/langscan.rake +42 -0
  147. data/test/langscan/brainfuck/test/test_scan.rb +55 -0
  148. data/test/langscan/c/test/test_scan.rb +216 -0
  149. data/test/langscan/c/test/test_token.rb +41 -0
  150. data/test/langscan/csharp/test/test_scan.rb +157 -0
  151. data/test/langscan/css/test/test_css.rb +79 -0
  152. data/test/langscan/d/test/test_scan.rb +233 -0
  153. data/test/langscan/d/test/test_token.rb +205 -0
  154. data/test/langscan/eiffel/test/test_eiffel.rb +95 -0
  155. data/test/langscan/elisp/test/test_elisp.rb +177 -0
  156. data/test/langscan/io/test/test_io.rb +79 -0
  157. data/test/langscan/java/test/test_java.rb +74 -0
  158. data/test/langscan/javascript/test/test_javascript.rb +39 -0
  159. data/test/langscan/lua/test/test_lua.rb +69 -0
  160. data/test/langscan/ocaml/test/test_ocaml.rb +161 -0
  161. data/test/langscan/php/test/test_scan.rb +138 -0
  162. data/test/langscan/python/test/test_scan.rb +105 -0
  163. data/test/langscan/rpmspec/test/test_rpmspec.rb +51 -0
  164. data/test/langscan/ruby/test/test_scan.rb +71 -0
  165. data/test/langscan/scheme/test/test_scan.rb +198 -0
  166. data/test/test_helper.rb +7 -0
  167. data/test/test_langscan.rb +123 -0
  168. metadata +296 -0
data/AUTHORS.txt ADDED
@@ -0,0 +1,19 @@
1
+ = Authors
2
+ == Maintainor:
3
+ * Kenichi Ishibashi <bashi at dream.ie.ariake-nct.ac.jp>
4
+
5
+ == LangScan modules written by:
6
+ * Satoru Takabayashi <satoru at namazu.org>
7
+ * Tanaka Akira <akr at m17n.org>
8
+ * Keisuke Nishida <knishida at open-cobol.org>
9
+ * Yoshinori K. Okuji <okuji at enbug.org>
10
+ * MATSUNO Tokuhiro <tokuhirom at yahoo.co.jp>
11
+ * Tatsuhiko Miyagawa <miyagawa at bulknews.net>
12
+ * Kouichirou Eto <2005 at eto.com>
13
+ * Soutaro Matsumoto <matsumoto at soutaro.com>
14
+ * shinichro.h <hamaji at nii.ac.jp>
15
+ * Yoshinori KUNIGA <kuniga at users.sourceforge.net>
16
+
17
+ == Gem version:
18
+ * mallowlabs <mallowlabs at gmail.com>
19
+
data/History.txt ADDED
@@ -0,0 +1,126 @@
1
+ === 2010-08-01 mallowlabs <mallowlabs@gmail.com>
2
+
3
+ * langscan: Gem install support
4
+
5
+ === 2007-01-15 Tanaka Akira <akr@fsij.org>
6
+
7
+ * langscan/_pairmatcher.rb: new method:
8
+ LangScan::PairMatcher.fragmentsorter.
9
+
10
+ * langscan/c.rb: reorder the scan result.
11
+
12
+ * langscan/csharp.rb: ditto.
13
+
14
+ * langscan/d.rb: ditto.
15
+
16
+ * langscan/elisp.rb: ditto.
17
+
18
+ * langscan/java.rb: ditto.
19
+
20
+ * langscan/javascript.rb: ditto.
21
+
22
+ * langscan/scheme.rb: ditto.
23
+
24
+ === 2006-12-22 Tanaka Akira <akr@fsij.org>
25
+
26
+ * langscan/c/ctok.l: permit invalid escape sequences such as \(.
27
+
28
+ === 2006-09-18 Tanaka Akira <akr@fsij.org>
29
+
30
+ * langscan/_template.c: use RARRAY_PTR and RARRAY_LEN if available.
31
+
32
+ * langscan/pairmatcher/pairmatcher.c: use RARRAY_PTR, RARRAY_LEN and
33
+ SYMBOL_P if available. Don't modify internal of an array directly.
34
+
35
+ === 2006-09-02 Tanaka Akira <akr@fsij.org>
36
+
37
+ * langscan/_template.c: use RSTRING_PTR and RSTRING_LEN if available.
38
+
39
+ === 2006-02-20 Tanaka Akira <akr@m17n.org>
40
+
41
+ * langscan/pairmatcher/pairmatcher.c: use RSTRUCT_PTR if available.
42
+
43
+ === 2006-01-08 Tanaka Akira <akr@m17n.org>
44
+
45
+ * langscan/pairmatcher/pairmatcher.c (pairmatcher_initialize):
46
+ fix a GC problem.
47
+
48
+ === 2006-01-05 Tanaka Akira <akr@m17n.org>
49
+
50
+ * autogen.sh: use $_.scan instead of scan because it is removed
51
+ at latest ruby-1.9.
52
+
53
+ * acinclude.m4 (RUBY_CFLAGS): add CCDLFLAGS because
54
+ -fPIC is required on x86_64.
55
+
56
+ === 2005-10-31 Kenichi Ishibashi <bashi@dream.ie.ariake-nct.ac.jp>
57
+
58
+ * configure.ac: Bumped version number to 1.2
59
+ * langscan.rb: Ditto.
60
+
61
+ * AUTHORS: Added `shinichiro.h <hamaji at nii.ac.jp>'.
62
+
63
+ === 2005-10-29 Shinichiro Hamaji <hamaji@nii.ac.jp>
64
+
65
+ * langscan/eiffle*: add Eiffel support
66
+
67
+ === 2005-10-27 Shinichiro Hamaji <hamaji@nii.ac.jp>
68
+
69
+ * langscan/lua*: add Lua support
70
+ * langscan/ocaml*: detect fun* around in comment
71
+ * langscan/io*: detect punct more precisely
72
+
73
+ === 2005-10-26 Shinichiro Hamaji <hamaji@nii.ac.jp>
74
+
75
+ * langscan/ocaml*: modify OCaml support to detech fundef & funcall
76
+ * langscan/d/test-d.rb: change TestScan to TestScanD
77
+
78
+ === 2005-10-25 Shinichiro Hamaji <hamaji@nii.ac.jp>
79
+
80
+ * langscan/io*: add Io support
81
+ * langscan/d*: add D support
82
+
83
+ === 2005-10-10 Kenichi Ishibashi <bashi@dream.ie.ariake-nct.ac.jp>
84
+
85
+ * langscan/ruby/compat/Makefile.am: Fix a bug that Ruby support
86
+ doesn't work on ruby 1.8.
87
+ * langscan/ruby/compat/ripper/Makefile.am: Ditto.
88
+
89
+ * README: Added examples.
90
+ * langscan/*.rb: Added comments for rdoc.
91
+ * Makefile.am: Added target `rdoc'.
92
+
93
+ === 2005-09-26 Kenichi Ishibashi <bashi@dream.ie.ariake-nct.ac.jp>
94
+
95
+ * langscan: Version 1.1 released.
96
+
97
+ === 2005-09-22 Kenichi Ishibashi <bashi@dream.ie.ariake-nct.ac.jp>
98
+
99
+ * configure.ac: Bumped version number to 1.1.
100
+ * langscan.rb: Ditto.
101
+
102
+ * langscan/ruby/compat/Makefile.am: EXTRA_DIST is available whenever
103
+ RUBY_RIPPER_AVAILABLE is true or not. [Gonzui-devel 375].
104
+
105
+ * tests/Makefile.am: Removed `pairmatcher.rb' and added `pairmatcher2.rb'.
106
+ * tests/pairmatcher.rb: Removed.
107
+ * tests/pairmatcher2.rb: New file. [Gonzui-devel 373].
108
+
109
+ * langscan/ruby/test/test-scan.rb: Renamed `TestScan' to
110
+ `TestRuby'. [Gonzui-devel 373].
111
+
112
+ === 2005-09-19 Satoru Takabayashi <satoru@namazu.org>
113
+
114
+ * tests/test-util.rb: Removed.
115
+
116
+ * langscan/ocaml.rb: Require langscan/_common for
117
+ LangScan::register.
118
+
119
+ === 2005-09-16 Kenichi Ishibashi <bashi at dream.ie.ariake-nct.ac.jp>
120
+
121
+ * langscan: version 1.0 released.
122
+
123
+ * langscan.rb: Added `VERSION'.
124
+ * configure.ac: Bumped version number to 1.0.
125
+ * langscan: Split off from gonzui repository.
126
+
data/Manifest.txt ADDED
@@ -0,0 +1,167 @@
1
+ AUTHORS.txt
2
+ History.txt
3
+ Manifest.txt
4
+ README.rdoc
5
+ Rakefile
6
+ ext/langscan/_make_c.rb
7
+ ext/langscan/_make_h.rb
8
+ ext/langscan/_template.c
9
+ ext/langscan/_template.h
10
+ ext/langscan/c/c/Makefile
11
+ ext/langscan/c/c/c.c
12
+ ext/langscan/c/c/c.h
13
+ ext/langscan/c/c/ctok.c
14
+ ext/langscan/c/c/ctok.l
15
+ ext/langscan/c/c/extconf.rb
16
+ ext/langscan/c/c/modulename.txt
17
+ ext/langscan/c/c/tokenlist.txt
18
+ ext/langscan/csharp/csharp/Makefile
19
+ ext/langscan/csharp/csharp/csharp.c
20
+ ext/langscan/csharp/csharp/csharp.h
21
+ ext/langscan/csharp/csharp/csharptok.c
22
+ ext/langscan/csharp/csharp/csharptok.l
23
+ ext/langscan/csharp/csharp/extconf.rb
24
+ ext/langscan/csharp/csharp/modulename.txt
25
+ ext/langscan/csharp/csharp/tokenlist.txt
26
+ ext/langscan/d/d/Makefile
27
+ ext/langscan/d/d/d.c
28
+ ext/langscan/d/d/d.h
29
+ ext/langscan/d/d/dtok.c
30
+ ext/langscan/d/d/dtok.l
31
+ ext/langscan/d/d/extconf.rb
32
+ ext/langscan/d/d/modulename.txt
33
+ ext/langscan/d/d/tokenlist.txt
34
+ ext/langscan/elisp/elisp/Makefile
35
+ ext/langscan/elisp/elisp/elisp.c
36
+ ext/langscan/elisp/elisp/elisp.h
37
+ ext/langscan/elisp/elisp/elisptok.c
38
+ ext/langscan/elisp/elisp/elisptok.l
39
+ ext/langscan/elisp/elisp/extconf.rb
40
+ ext/langscan/elisp/elisp/modulename.txt
41
+ ext/langscan/elisp/elisp/tokenlist.txt
42
+ ext/langscan/java/java/Makefile
43
+ ext/langscan/java/java/extconf.rb
44
+ ext/langscan/java/java/java.c
45
+ ext/langscan/java/java/java.h
46
+ ext/langscan/java/java/javatok.c
47
+ ext/langscan/java/java/javatok.l
48
+ ext/langscan/java/java/modulename.txt
49
+ ext/langscan/java/java/tokenlist.txt
50
+ ext/langscan/javascript/javascript/Makefile
51
+ ext/langscan/javascript/javascript/extconf.rb
52
+ ext/langscan/javascript/javascript/javascript.c
53
+ ext/langscan/javascript/javascript/javascript.h
54
+ ext/langscan/javascript/javascript/javascripttok.c
55
+ ext/langscan/javascript/javascript/javascripttok.l
56
+ ext/langscan/javascript/javascript/modulename.txt
57
+ ext/langscan/javascript/javascript/tokenlist.txt
58
+ ext/langscan/pairmatcher/pairmatcher/Makefile
59
+ ext/langscan/pairmatcher/pairmatcher/extconf.rb
60
+ ext/langscan/pairmatcher/pairmatcher/pairmatcher.c
61
+ ext/langscan/php/php/Makefile
62
+ ext/langscan/php/php/extconf.rb
63
+ ext/langscan/php/php/modulename.txt
64
+ ext/langscan/php/php/php.c
65
+ ext/langscan/php/php/php.h
66
+ ext/langscan/php/php/phptok.c
67
+ ext/langscan/php/php/phptok.l
68
+ ext/langscan/php/php/tokenlist.txt
69
+ ext/langscan/post-distclean.rb
70
+ ext/langscan/pre-config.rb
71
+ ext/langscan/python/python/Makefile
72
+ ext/langscan/python/python/extconf.rb
73
+ ext/langscan/python/python/modulename.txt
74
+ ext/langscan/python/python/python.c
75
+ ext/langscan/python/python/python.h
76
+ ext/langscan/python/python/pythontok.c
77
+ ext/langscan/python/python/pythontok.l
78
+ ext/langscan/python/python/tokenlist.txt
79
+ ext/langscan/ruby/compat/ripper/Makefile
80
+ ext/langscan/ruby/compat/ripper/depend
81
+ ext/langscan/ruby/compat/ripper/extconf.rb
82
+ ext/langscan/ruby/compat/ripper/include/eventids1.c
83
+ ext/langscan/ruby/compat/ripper/include/eventids2.c
84
+ ext/langscan/ruby/compat/ripper/include/lex.c
85
+ ext/langscan/ruby/compat/ripper/ripper.c
86
+ ext/langscan/scheme/scheme/Makefile
87
+ ext/langscan/scheme/scheme/extconf.rb
88
+ ext/langscan/scheme/scheme/modulename.txt
89
+ ext/langscan/scheme/scheme/scheme.c
90
+ ext/langscan/scheme/scheme/scheme.h
91
+ ext/langscan/scheme/scheme/schemetok.c
92
+ ext/langscan/scheme/scheme/schemetok.l
93
+ ext/langscan/scheme/scheme/tokenlist.txt
94
+ ext/langscan/sh/sh/Makefile
95
+ ext/langscan/sh/sh/extconf.rb
96
+ ext/langscan/sh/sh/modulename.txt
97
+ ext/langscan/sh/sh/sh.c
98
+ ext/langscan/sh/sh/sh.h
99
+ ext/langscan/sh/sh/shtok.c
100
+ ext/langscan/sh/sh/shtok.l
101
+ ext/langscan/sh/sh/tokenlist.txt
102
+ lib/langscan.rb
103
+ lib/langscan/_common.rb
104
+ lib/langscan/_easyscanner.rb
105
+ lib/langscan/_pairmatcher.rb
106
+ lib/langscan/_type.rb
107
+ lib/langscan/autoconf.rb
108
+ lib/langscan/automake.rb
109
+ lib/langscan/brainfuck.rb
110
+ lib/langscan/c.rb
111
+ lib/langscan/csharp.rb
112
+ lib/langscan/css.rb
113
+ lib/langscan/d.rb
114
+ lib/langscan/eiffel.rb
115
+ lib/langscan/elisp.rb
116
+ lib/langscan/io.rb
117
+ lib/langscan/java.rb
118
+ lib/langscan/javascript.rb
119
+ lib/langscan/lua.rb
120
+ lib/langscan/ocaml.rb
121
+ lib/langscan/ocaml/camlexer.ml
122
+ lib/langscan/ocaml/lexer.mll
123
+ lib/langscan/ocaml/types.ml
124
+ lib/langscan/perl.rb
125
+ lib/langscan/perl/tokenizer.pl
126
+ lib/langscan/php.rb
127
+ lib/langscan/python.rb
128
+ lib/langscan/rpmspec.rb
129
+ lib/langscan/ruby.rb
130
+ lib/langscan/ruby/compat/README
131
+ lib/langscan/ruby/compat/ripper.rb
132
+ lib/langscan/ruby/compat/ripper/core.rb
133
+ lib/langscan/ruby/compat/ripper/filter.rb
134
+ lib/langscan/ruby/compat/ripper/lexer.rb
135
+ lib/langscan/ruby/compat/ripper/sexp.rb
136
+ lib/langscan/scheme.rb
137
+ lib/langscan/sh.rb
138
+ lib/langscan/text.rb
139
+ metaconfig
140
+ script/console
141
+ script/destroy
142
+ script/generate
143
+ script/makemanifest.rb
144
+ setup.rb
145
+ tasks/extconf.rake
146
+ tasks/extconf/langscan.rake
147
+ test/langscan/brainfuck/test/test_scan.rb
148
+ test/langscan/c/test/test_scan.rb
149
+ test/langscan/c/test/test_token.rb
150
+ test/langscan/csharp/test/test_scan.rb
151
+ test/langscan/css/test/test_css.rb
152
+ test/langscan/d/test/test_scan.rb
153
+ test/langscan/d/test/test_token.rb
154
+ test/langscan/eiffel/test/test_eiffel.rb
155
+ test/langscan/elisp/test/test_elisp.rb
156
+ test/langscan/io/test/test_io.rb
157
+ test/langscan/java/test/test_java.rb
158
+ test/langscan/javascript/test/test_javascript.rb
159
+ test/langscan/lua/test/test_lua.rb
160
+ test/langscan/ocaml/test/test_ocaml.rb
161
+ test/langscan/php/test/test_scan.rb
162
+ test/langscan/python/test/test_scan.rb
163
+ test/langscan/rpmspec/test/test_rpmspec.rb
164
+ test/langscan/ruby/test/test_scan.rb
165
+ test/langscan/scheme/test/test_scan.rb
166
+ test/test_helper.rb
167
+ test/test_langscan.rb
data/README.rdoc ADDED
@@ -0,0 +1,89 @@
1
+ = LangScan
2
+
3
+ * http://gonzui.sourceforge.net/langscan/index.html.en
4
+ * Gem version
5
+ * http://github.com/mallowlabs/langscan
6
+
7
+ == DESCRIPTION:
8
+
9
+ program analyzer for source code search engine
10
+
11
+ == FEATURES/PROBLEMS:
12
+
13
+ * Support Languages
14
+ * C
15
+ * C++
16
+ * C#
17
+ * Java
18
+ * JavaScript
19
+ * Ruby
20
+ * Python
21
+ * PHP
22
+ * Perl
23
+ * Objective Caml
24
+ * Brainfuck
25
+ * CSS
26
+ * Shell Script
27
+ * Emacs Lisp
28
+ * Scheme
29
+ * Plain Text
30
+ * Io
31
+ * Lua
32
+ * Eiffel
33
+
34
+ == SYNOPSIS:
35
+ === Example1
36
+ % cat -n hello.c
37
+ 1 #include <stdio.h>
38
+ 2
39
+ 3 int main(int argc, char **argv)
40
+ 4 {
41
+ 5 printf("Hello World.\n");
42
+ 6 return 0;
43
+ 7 }
44
+ % ruby -rlangscan/c -e 'LangScan::C.scan(ARGF.readlines.join) {|f| p f}' < hello.c
45
+ #<LangScan::Fragment space " " 1 (8)>
46
+ #<LangScan::Fragment ident "stdio" 1 (10)>
47
+ #<LangScan::Fragment punct "." 1 (15)>
48
+ #<LangScan::Fragment space "\n" 2 (19)>
49
+ #<LangScan::Fragment space " " 3 (23)>
50
+ #<LangScan::Fragment preproc_beg "#" 1 (0)>
51
+ #<LangScan::Fragment ident "include" 1 (1)>
52
+ ...
53
+
54
+ === Example2
55
+ % cat -n display_fundef.rb
56
+ 1 require 'langscan'
57
+ 2
58
+ 3 # display all function definitions.
59
+ 4 ARGV.each {|arg|
60
+ 5 next unless scanner = LangScan.choose(arg)
61
+ 6 scanner.scan(File.open(arg).readlines.join) {|f|
62
+ 7 if f.type == :fundef
63
+ 8 puts f.text
64
+ 9 end
65
+ 10 }
66
+ 11 }
67
+ % ruby display_fundef.rb hello.c
68
+ main
69
+
70
+ == REQUIREMENTS:
71
+
72
+ * Ruby 1.8.2+
73
+ * Perl + PPI module (for source codes written in Perl)
74
+ * OCaml (for source codes written in OCaml)
75
+
76
+ == INSTALL:
77
+
78
+ * sudo gem install langscan
79
+
80
+ == LICENSE:
81
+ Copyright (C) 2004-2005 Satoru Takabayashi <satoru@namazu.org>
82
+ All rights reserved.
83
+ This is free software with ABSOLUTELY NO WARRANTY.
84
+
85
+ You can redistribute it and/or modify it under the terms of
86
+ the GNU General Public License version 2.
87
+
88
+ == AUTHORS:
89
+ see 'AUTHORS.txt'
data/Rakefile ADDED
@@ -0,0 +1,40 @@
1
+ require 'rubygems'
2
+ gem 'hoe', '>= 2.1.0'
3
+ require 'hoe'
4
+ require 'fileutils'
5
+ require './lib/langscan'
6
+
7
+ Hoe.plugin :newgem
8
+ # Hoe.plugin :website
9
+ # Hoe.plugin :cucumberfeatures
10
+
11
+ # Generate all the Rake tasks
12
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
13
+ $hoe = Hoe.spec 'langscan' do
14
+ self.developer 'mallowlabs', 'mallowlabs@gmail.com'
15
+ # self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
16
+ self.rubyforge_name = self.name # TODO this is default value
17
+ # self.extra_deps = [['activesupport','>= 2.0.2']]
18
+
19
+ end
20
+
21
+ require 'newgem/tasks'
22
+ Dir['tasks/**/*.rake'].each { |t| load t }
23
+
24
+ # TODO - want other tests/tasks run by default? Add them to the list
25
+ # remove_task :default
26
+ # task :default => [:spec, :features]
27
+
28
+ namespace :setup do
29
+ desc "setup.rb config"
30
+ task :config do
31
+ ruby "setup.rb config"
32
+ end
33
+
34
+ desc "setup.rb distclean"
35
+ task :distclean do
36
+ ruby "setup.rb distclean"
37
+ end
38
+ end
39
+
40
+
@@ -0,0 +1,20 @@
1
+ require 'fileutils'
2
+ raise unless ARGV.length == 4
3
+ template_file_name = ARGV.shift
4
+ output_directory = ARGV.shift
5
+ lang_abbrev = ARGV.shift
6
+ module_name = ARGV.shift
7
+
8
+ template = File.read(template_file_name)
9
+ template.gsub!(/LANGNAME/, lang_abbrev.upcase)
10
+ template.gsub!(/langname/, lang_abbrev.downcase)
11
+ template.gsub!(/LangName/, module_name)
12
+
13
+ c_file_name = File.join( output_directory, lang_abbrev + ".c" )
14
+ FileUtils.rm_f(c_file_name)
15
+ File.open(c_file_name, "w") {|f|
16
+ # f.printf("/* %s generated automatically from %s */\n",
17
+ # c_file_name, template_file_name)
18
+ f.print template
19
+ }
20
+ #File.chmod(0444, c_file_name)