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
@@ -0,0 +1,155 @@
1
+ /*
2
+ * pythontok.l - a lex rule for python
3
+ *
4
+ * Copyright (C) 2005 Yoshinori K. Okuji <okuji@enbug.org>
5
+ * All rights reserved.
6
+ * This is free software with ABSOLUTELY NO WARRANTY.
7
+ *
8
+ * You can redistribute it and/or modify it under the terms of
9
+ * the GNU General Public License version 2.
10
+ */
11
+
12
+ %option reentrant
13
+ %option prefix="langscan_python_lex_"
14
+ %option noyywrap
15
+ %option nodefault
16
+
17
+ newline \r\n|\r|\n
18
+ stringprefix r|u|ur|R|U|UR|Ur|uR
19
+ escseq \\({newline}|.)
20
+ shortstring '([^\\\n\r']|{escseq})*'|\"([^\\\n\r\"]|{escseq})*\"
21
+ longstring '''('{1,2}[^']|[^\\']|{escseq})*'''|\"\"\"(\"{1,2}[^\"]|[^\\\"]|{escseq})*\"\"\"
22
+ string {stringprefix}?({longstring}|{shortstring})
23
+ integer 0[xX][0-9a-fA-F]+|[0-9]+
24
+ longinteger {integer}[lL]
25
+ pointfloat [0-9]*\.[0-9]+|[0-9]+\.
26
+ exponent [eE][+\-][0-9]+
27
+ floatnumber {pointfloat}{exponent}?|[0-9]+{exponent}
28
+ imagnumber {floatnumber}|{integer}[jJ]
29
+
30
+ %{
31
+
32
+ #include "python.h"
33
+
34
+ #define YY_EXTRA_TYPE langscan_python_lex_extra_t *
35
+
36
+ #if YY_NULL != 0
37
+ #error "YY_NULL is not 0."
38
+ #endif
39
+
40
+ #define YY_DECL langscan_python_token_t langscan_python_lex_lex(yyscan_t yyscanner)
41
+
42
+ #define YY_INPUT(buf,result,max_size) \
43
+ if (!yyextra->eof) { \
44
+ result = yyextra->user_read(&(yyextra->user_data), (buf), (max_size)); \
45
+ if (result == 0) \
46
+ yyextra->eof = 1; \
47
+ }
48
+
49
+ #define UPD update_pos(yyextra, yytext, yyleng)
50
+ static void update_pos(langscan_python_lex_extra_t *, char *, int);
51
+
52
+ #define report(token) \
53
+ do { \
54
+ yyextra->text = yytext; \
55
+ yyextra->leng = yyleng; \
56
+ return langscan_python_##token; \
57
+ } while (0)
58
+
59
+ %}
60
+
61
+ %%
62
+ [ \t\f]+ { UPD; report(space); }
63
+ {newline} { UPD; report(space); }
64
+ \#.* { UPD; report(comment); }
65
+ {string} { UPD; report(string); }
66
+ {integer}|{longinteger} { UPD; report(integer); }
67
+ {floatnumber} { UPD; report(floating); }
68
+ {imagnumber} { UPD; report(imaginary); }
69
+ [A-Za-z_][0-9A-Za-z_]* { UPD; report(ident); }
70
+ . { UPD; report(punct); }
71
+
72
+ %%
73
+
74
+ static void update_pos(
75
+ langscan_python_lex_extra_t *extra,
76
+ char *text,
77
+ int leng)
78
+ {
79
+ int i, j;
80
+ extra->beg_byteno = extra->end_byteno;
81
+ extra->beg_lineno = extra->end_lineno;
82
+ extra->beg_columnno = extra->end_columnno;
83
+ j = 0;
84
+ for (i = 0; i < leng; i++) {
85
+ if (text[i] == '\r' || (i == 0 || text[i - 1] != '\r') && text[i] == '\n') {
86
+ extra->end_lineno++;
87
+ j = i + 1;
88
+ extra->end_columnno = 0;
89
+ }
90
+ }
91
+ extra->end_columnno += leng - j;
92
+ extra->end_byteno += leng;
93
+ }
94
+
95
+ langscan_python_tokenizer_t *langscan_python_make_tokenizer(
96
+ size_t (*user_read)(void **user_data_p, char *buf, size_t maxlen),
97
+ void *user_data)
98
+ {
99
+ langscan_python_tokenizer_t *tokenizer;
100
+ langscan_python_lex_extra_t *extra;
101
+ tokenizer = (langscan_python_tokenizer_t *)malloc(sizeof(langscan_python_tokenizer_t));
102
+ if (tokenizer == NULL)
103
+ return NULL;
104
+ extra = (langscan_python_lex_extra_t *)malloc(sizeof(langscan_python_lex_extra_t));
105
+ if (extra == NULL)
106
+ return NULL;
107
+ extra->user_read = user_read;
108
+ extra->user_data = user_data;
109
+ extra->beg_lineno = 1;
110
+ extra->beg_columnno = 0;
111
+ extra->beg_byteno = 0;
112
+ extra->end_lineno = 1;
113
+ extra->end_columnno = 0;
114
+ extra->end_byteno = 0;
115
+ extra->eof = 0;
116
+ tokenizer->extra = extra;
117
+ langscan_python_lex_lex_init(&tokenizer->scanner);
118
+ langscan_python_lex_set_extra(extra, tokenizer->scanner);
119
+ return tokenizer;
120
+ }
121
+
122
+ langscan_python_token_t langscan_python_get_token(langscan_python_tokenizer_t *tokenizer)
123
+ {
124
+ return langscan_python_lex_lex(tokenizer->scanner);
125
+ }
126
+
127
+ void langscan_python_free_tokenizer(langscan_python_tokenizer_t *tokenizer)
128
+ {
129
+ langscan_python_lex_extra_t *extra = langscan_python_lex_get_extra(tokenizer->scanner);
130
+ free((void *)extra);
131
+ langscan_python_lex_lex_destroy(tokenizer->scanner);
132
+ free((void *)tokenizer);
133
+ }
134
+
135
+ user_read_t langscan_python_tokenizer_get_user_read(langscan_python_tokenizer_t *tokenizer)
136
+ {
137
+ return tokenizer->extra->user_read;
138
+ }
139
+
140
+ void *langscan_python_tokenizer_get_user_data(langscan_python_tokenizer_t *tokenizer)
141
+ {
142
+ return tokenizer->extra->user_data;
143
+ }
144
+
145
+ const char *langscan_python_token_name(langscan_python_token_t token)
146
+ {
147
+ static char *token_names[] = {
148
+ "*eof*",
149
+ #define LANGSCAN_PYTHON_TOKEN(name) #name,
150
+ LANGSCAN_PYTHON_TOKEN_LIST
151
+ #undef LANGSCAN_PYTHON_TOKEN
152
+ };
153
+
154
+ return token_names[token];
155
+ }
@@ -0,0 +1,8 @@
1
+ integer
2
+ floating
3
+ imaginary
4
+ string
5
+ ident
6
+ punct
7
+ comment
8
+ space
@@ -0,0 +1,158 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ #### Start of system configuration section. ####
5
+
6
+ srcdir = /Users/osuka/devel/git/langscan/ext/langscan/ruby/compat/ripper
7
+ topdir = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0
8
+ hdrdir = $(topdir)
9
+ VPATH = $(srcdir):$(topdir):$(hdrdir)
10
+ exec_prefix = $(prefix)
11
+ prefix = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr
12
+ sharedstatedir = $(prefix)/com
13
+ mandir = $(DESTDIR)/usr/share/man
14
+ psdir = $(docdir)
15
+ oldincludedir = $(DESTDIR)/usr/include
16
+ localedir = $(datarootdir)/locale
17
+ bindir = $(exec_prefix)/bin
18
+ libexecdir = $(exec_prefix)/libexec
19
+ sitedir = $(DESTDIR)/Library/Ruby/Site
20
+ htmldir = $(docdir)
21
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
22
+ includedir = $(prefix)/include
23
+ infodir = $(DESTDIR)/usr/share/info
24
+ vendorlibdir = $(vendordir)/$(ruby_version)
25
+ sysconfdir = $(prefix)/etc
26
+ libdir = $(exec_prefix)/lib
27
+ sbindir = $(exec_prefix)/sbin
28
+ rubylibdir = $(libdir)/ruby/$(ruby_version)
29
+ docdir = $(datarootdir)/doc/$(PACKAGE)
30
+ dvidir = $(docdir)
31
+ vendordir = $(libdir)/ruby/vendor_ruby
32
+ datarootdir = $(prefix)/share
33
+ pdfdir = $(docdir)
34
+ archdir = $(rubylibdir)/$(arch)
35
+ sitearchdir = $(sitelibdir)/$(sitearch)
36
+ datadir = $(datarootdir)
37
+ localstatedir = $(prefix)/var
38
+ sitelibdir = $(sitedir)/$(ruby_version)
39
+
40
+ CC = gcc
41
+ LIBRUBY = $(LIBRUBY_SO)
42
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
43
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
44
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)
45
+
46
+ RUBY_EXTCONF_H =
47
+ CFLAGS = -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common $(cflags) -DRIPPER -Iinclude
48
+ INCFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
49
+ DEFS =
50
+ CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE $(DEFS) $(cppflags)
51
+ CXXFLAGS = $(CFLAGS)
52
+ ldflags = -L. -arch i386 -arch x86_64
53
+ dldflags =
54
+ archflag =
55
+ DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
56
+ LDSHARED = cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup
57
+ AR = ar
58
+ EXEEXT =
59
+
60
+ RUBY_INSTALL_NAME = ruby
61
+ RUBY_SO_NAME = ruby
62
+ arch = universal-darwin10.0
63
+ sitearch = universal-darwin10.0
64
+ ruby_version = 1.8
65
+ ruby = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
66
+ RUBY = $(ruby)
67
+ RM = rm -f
68
+ MAKEDIRS = mkdir -p
69
+ INSTALL = /usr/bin/install -c
70
+ INSTALL_PROG = $(INSTALL) -m 0755
71
+ INSTALL_DATA = $(INSTALL) -m 644
72
+ COPY = cp
73
+
74
+ #### End of system configuration section. ####
75
+
76
+ preload =
77
+
78
+ libpath = . $(libdir)
79
+ LIBPATH = -L. -L$(libdir)
80
+ DEFFILE =
81
+
82
+ CLEANFILES = mkmf.log
83
+ DISTCLEANFILES =
84
+
85
+ extout =
86
+ extout_prefix =
87
+ target_prefix = /langscan/ruby/compat
88
+ LOCAL_LIBS =
89
+ LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl
90
+ SRCS = ripper.c
91
+ OBJS = ripper.o
92
+ TARGET = ripper
93
+ DLLIB = $(TARGET).bundle
94
+ EXTSTATIC =
95
+ STATIC_LIB =
96
+
97
+ BINDIR = $(bindir)
98
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
99
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
100
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
101
+
102
+ TARGET_SO = $(DLLIB)
103
+ CLEANLIBS = $(TARGET).bundle $(TARGET).il? $(TARGET).tds $(TARGET).map
104
+ CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
105
+
106
+ all: $(DLLIB)
107
+ static: $(STATIC_LIB)
108
+
109
+ clean:
110
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
111
+
112
+ distclean: clean
113
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
114
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
115
+
116
+ realclean: distclean
117
+ install: install-so install-rb
118
+
119
+ install-so: $(RUBYARCHDIR)
120
+ install-so: $(RUBYARCHDIR)/$(DLLIB)
121
+ $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
122
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
123
+ install-rb: pre-install-rb install-rb-default
124
+ install-rb-default: pre-install-rb-default
125
+ pre-install-rb: Makefile
126
+ pre-install-rb-default: Makefile
127
+ $(RUBYARCHDIR):
128
+ $(MAKEDIRS) $@
129
+
130
+ site-install: site-install-so site-install-rb
131
+ site-install-so: install-so
132
+ site-install-rb: install-rb
133
+
134
+ .SUFFIXES: .c .m .cc .cxx .cpp .C .o
135
+
136
+ .cc.o:
137
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
138
+
139
+ .cxx.o:
140
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
141
+
142
+ .cpp.o:
143
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
144
+
145
+ .C.o:
146
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
147
+
148
+ .c.o:
149
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
150
+
151
+ $(DLLIB): $(OBJS) Makefile
152
+ @-$(RM) $@
153
+ $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
154
+
155
+
156
+
157
+ ###
158
+ ripper.c: include/eventids1.c include/eventids2.c include/lex.c
@@ -0,0 +1 @@
1
+ ripper.c: include/eventids1.c include/eventids2.c include/lex.c
@@ -0,0 +1,4 @@
1
+ require 'mkmf'
2
+
3
+ $CFLAGS += " -DRIPPER -Iinclude"
4
+ create_makefile('langscan/ruby/compat/ripper')
@@ -0,0 +1,251 @@
1
+ static ID ripper_id_BEGIN;
2
+ static ID ripper_id_END;
3
+ static ID ripper_id_alias;
4
+ static ID ripper_id_alias_error;
5
+ static ID ripper_id_aref;
6
+ static ID ripper_id_aref_field;
7
+ static ID ripper_id_arg_ambiguous;
8
+ static ID ripper_id_arg_paren;
9
+ static ID ripper_id_arglist_add;
10
+ static ID ripper_id_arglist_add_block;
11
+ static ID ripper_id_arglist_add_star;
12
+ static ID ripper_id_arglist_new;
13
+ static ID ripper_id_arglist_prepend;
14
+ static ID ripper_id_array;
15
+ static ID ripper_id_assign;
16
+ static ID ripper_id_assign_error;
17
+ static ID ripper_id_assoc_new;
18
+ static ID ripper_id_assoclist_from_args;
19
+ static ID ripper_id_bare_assoc_hash;
20
+ static ID ripper_id_begin;
21
+ static ID ripper_id_binary;
22
+ static ID ripper_id_blockvar_add_block;
23
+ static ID ripper_id_blockvar_add_star;
24
+ static ID ripper_id_blockvar_new;
25
+ static ID ripper_id_bodystmt;
26
+ static ID ripper_id_brace_block;
27
+ static ID ripper_id_break;
28
+ static ID ripper_id_call;
29
+ static ID ripper_id_case;
30
+ static ID ripper_id_class;
31
+ static ID ripper_id_class_name_error;
32
+ static ID ripper_id_command;
33
+ static ID ripper_id_command_call;
34
+ static ID ripper_id_const_ref;
35
+ static ID ripper_id_constpath_field;
36
+ static ID ripper_id_constpath_ref;
37
+ static ID ripper_id_def;
38
+ static ID ripper_id_defined;
39
+ static ID ripper_id_defs;
40
+ static ID ripper_id_do_block;
41
+ static ID ripper_id_do_block;
42
+ static ID ripper_id_dot2;
43
+ static ID ripper_id_dot3;
44
+ static ID ripper_id_dyna_symbol;
45
+ static ID ripper_id_else;
46
+ static ID ripper_id_elsif;
47
+ static ID ripper_id_ensure;
48
+ static ID ripper_id_fcall;
49
+ static ID ripper_id_field;
50
+ static ID ripper_id_for;
51
+ static ID ripper_id_hash;
52
+ static ID ripper_id_if;
53
+ static ID ripper_id_if_mod;
54
+ static ID ripper_id_ifop;
55
+ static ID ripper_id_iter_block;
56
+ static ID ripper_id_lambda;
57
+ static ID ripper_id_massign;
58
+ static ID ripper_id_method_add_arg;
59
+ static ID ripper_id_mlhs_add;
60
+ static ID ripper_id_mlhs_add_star;
61
+ static ID ripper_id_mlhs_new;
62
+ static ID ripper_id_mlhs_paren;
63
+ static ID ripper_id_module;
64
+ static ID ripper_id_mrhs_add;
65
+ static ID ripper_id_mrhs_add_star;
66
+ static ID ripper_id_mrhs_new;
67
+ static ID ripper_id_mrhs_new_from_arglist;
68
+ static ID ripper_id_next;
69
+ static ID ripper_id_opassign;
70
+ static ID ripper_id_param_error;
71
+ static ID ripper_id_params;
72
+ static ID ripper_id_paren;
73
+ static ID ripper_id_parse_error;
74
+ static ID ripper_id_pragma;
75
+ static ID ripper_id_program;
76
+ static ID ripper_id_qwords_add;
77
+ static ID ripper_id_qwords_new;
78
+ static ID ripper_id_redo;
79
+ static ID ripper_id_regexp_literal;
80
+ static ID ripper_id_rescue;
81
+ static ID ripper_id_rescue_mod;
82
+ static ID ripper_id_restparam;
83
+ static ID ripper_id_retry;
84
+ static ID ripper_id_return;
85
+ static ID ripper_id_return0;
86
+ static ID ripper_id_sclass;
87
+ static ID ripper_id_space;
88
+ static ID ripper_id_stmts_add;
89
+ static ID ripper_id_stmts_new;
90
+ static ID ripper_id_string_add;
91
+ static ID ripper_id_string_concat;
92
+ static ID ripper_id_string_content;
93
+ static ID ripper_id_string_dvar;
94
+ static ID ripper_id_string_embexpr;
95
+ static ID ripper_id_string_literal;
96
+ static ID ripper_id_super;
97
+ static ID ripper_id_symbol;
98
+ static ID ripper_id_symbol_literal;
99
+ static ID ripper_id_topconst_field;
100
+ static ID ripper_id_topconst_ref;
101
+ static ID ripper_id_unary;
102
+ static ID ripper_id_undef;
103
+ static ID ripper_id_unless;
104
+ static ID ripper_id_unless_mod;
105
+ static ID ripper_id_until;
106
+ static ID ripper_id_until_mod;
107
+ static ID ripper_id_var_alias;
108
+ static ID ripper_id_var_field;
109
+ static ID ripper_id_var_ref;
110
+ static ID ripper_id_void_stmt;
111
+ static ID ripper_id_when;
112
+ static ID ripper_id_while;
113
+ static ID ripper_id_while_mod;
114
+ static ID ripper_id_word_add;
115
+ static ID ripper_id_word_new;
116
+ static ID ripper_id_words_add;
117
+ static ID ripper_id_words_new;
118
+ static ID ripper_id_xstring_add;
119
+ static ID ripper_id_xstring_literal;
120
+ static ID ripper_id_xstring_new;
121
+ static ID ripper_id_yield;
122
+ static ID ripper_id_yield0;
123
+ static ID ripper_id_zsuper;
124
+
125
+ static void
126
+ ripper_init_eventids1()
127
+ {
128
+ ripper_id_BEGIN = rb_intern("on_BEGIN");
129
+ ripper_id_END = rb_intern("on_END");
130
+ ripper_id_alias = rb_intern("on_alias");
131
+ ripper_id_alias_error = rb_intern("on_alias_error");
132
+ ripper_id_aref = rb_intern("on_aref");
133
+ ripper_id_aref_field = rb_intern("on_aref_field");
134
+ ripper_id_arg_ambiguous = rb_intern("on_arg_ambiguous");
135
+ ripper_id_arg_paren = rb_intern("on_arg_paren");
136
+ ripper_id_arglist_add = rb_intern("on_arglist_add");
137
+ ripper_id_arglist_add_block = rb_intern("on_arglist_add_block");
138
+ ripper_id_arglist_add_star = rb_intern("on_arglist_add_star");
139
+ ripper_id_arglist_new = rb_intern("on_arglist_new");
140
+ ripper_id_arglist_prepend = rb_intern("on_arglist_prepend");
141
+ ripper_id_array = rb_intern("on_array");
142
+ ripper_id_assign = rb_intern("on_assign");
143
+ ripper_id_assign_error = rb_intern("on_assign_error");
144
+ ripper_id_assoc_new = rb_intern("on_assoc_new");
145
+ ripper_id_assoclist_from_args = rb_intern("on_assoclist_from_args");
146
+ ripper_id_bare_assoc_hash = rb_intern("on_bare_assoc_hash");
147
+ ripper_id_begin = rb_intern("on_begin");
148
+ ripper_id_binary = rb_intern("on_binary");
149
+ ripper_id_blockvar_add_block = rb_intern("on_blockvar_add_block");
150
+ ripper_id_blockvar_add_star = rb_intern("on_blockvar_add_star");
151
+ ripper_id_blockvar_new = rb_intern("on_blockvar_new");
152
+ ripper_id_bodystmt = rb_intern("on_bodystmt");
153
+ ripper_id_brace_block = rb_intern("on_brace_block");
154
+ ripper_id_break = rb_intern("on_break");
155
+ ripper_id_call = rb_intern("on_call");
156
+ ripper_id_case = rb_intern("on_case");
157
+ ripper_id_class = rb_intern("on_class");
158
+ ripper_id_class_name_error = rb_intern("on_class_name_error");
159
+ ripper_id_command = rb_intern("on_command");
160
+ ripper_id_command_call = rb_intern("on_command_call");
161
+ ripper_id_const_ref = rb_intern("on_const_ref");
162
+ ripper_id_constpath_field = rb_intern("on_constpath_field");
163
+ ripper_id_constpath_ref = rb_intern("on_constpath_ref");
164
+ ripper_id_def = rb_intern("on_def");
165
+ ripper_id_defined = rb_intern("on_defined");
166
+ ripper_id_defs = rb_intern("on_defs");
167
+ ripper_id_do_block = rb_intern("on_do_block");
168
+ ripper_id_do_block = rb_intern("on_do_block");
169
+ ripper_id_dot2 = rb_intern("on_dot2");
170
+ ripper_id_dot3 = rb_intern("on_dot3");
171
+ ripper_id_dyna_symbol = rb_intern("on_dyna_symbol");
172
+ ripper_id_else = rb_intern("on_else");
173
+ ripper_id_elsif = rb_intern("on_elsif");
174
+ ripper_id_ensure = rb_intern("on_ensure");
175
+ ripper_id_fcall = rb_intern("on_fcall");
176
+ ripper_id_field = rb_intern("on_field");
177
+ ripper_id_for = rb_intern("on_for");
178
+ ripper_id_hash = rb_intern("on_hash");
179
+ ripper_id_if = rb_intern("on_if");
180
+ ripper_id_if_mod = rb_intern("on_if_mod");
181
+ ripper_id_ifop = rb_intern("on_ifop");
182
+ ripper_id_iter_block = rb_intern("on_iter_block");
183
+ ripper_id_lambda = rb_intern("on_lambda");
184
+ ripper_id_massign = rb_intern("on_massign");
185
+ ripper_id_method_add_arg = rb_intern("on_method_add_arg");
186
+ ripper_id_mlhs_add = rb_intern("on_mlhs_add");
187
+ ripper_id_mlhs_add_star = rb_intern("on_mlhs_add_star");
188
+ ripper_id_mlhs_new = rb_intern("on_mlhs_new");
189
+ ripper_id_mlhs_paren = rb_intern("on_mlhs_paren");
190
+ ripper_id_module = rb_intern("on_module");
191
+ ripper_id_mrhs_add = rb_intern("on_mrhs_add");
192
+ ripper_id_mrhs_add_star = rb_intern("on_mrhs_add_star");
193
+ ripper_id_mrhs_new = rb_intern("on_mrhs_new");
194
+ ripper_id_mrhs_new_from_arglist = rb_intern("on_mrhs_new_from_arglist");
195
+ ripper_id_next = rb_intern("on_next");
196
+ ripper_id_opassign = rb_intern("on_opassign");
197
+ ripper_id_param_error = rb_intern("on_param_error");
198
+ ripper_id_params = rb_intern("on_params");
199
+ ripper_id_paren = rb_intern("on_paren");
200
+ ripper_id_parse_error = rb_intern("on_parse_error");
201
+ ripper_id_pragma = rb_intern("on_pragma");
202
+ ripper_id_program = rb_intern("on_program");
203
+ ripper_id_qwords_add = rb_intern("on_qwords_add");
204
+ ripper_id_qwords_new = rb_intern("on_qwords_new");
205
+ ripper_id_redo = rb_intern("on_redo");
206
+ ripper_id_regexp_literal = rb_intern("on_regexp_literal");
207
+ ripper_id_rescue = rb_intern("on_rescue");
208
+ ripper_id_rescue_mod = rb_intern("on_rescue_mod");
209
+ ripper_id_restparam = rb_intern("on_restparam");
210
+ ripper_id_retry = rb_intern("on_retry");
211
+ ripper_id_return = rb_intern("on_return");
212
+ ripper_id_return0 = rb_intern("on_return0");
213
+ ripper_id_sclass = rb_intern("on_sclass");
214
+ ripper_id_space = rb_intern("on_space");
215
+ ripper_id_stmts_add = rb_intern("on_stmts_add");
216
+ ripper_id_stmts_new = rb_intern("on_stmts_new");
217
+ ripper_id_string_add = rb_intern("on_string_add");
218
+ ripper_id_string_concat = rb_intern("on_string_concat");
219
+ ripper_id_string_content = rb_intern("on_string_content");
220
+ ripper_id_string_dvar = rb_intern("on_string_dvar");
221
+ ripper_id_string_embexpr = rb_intern("on_string_embexpr");
222
+ ripper_id_string_literal = rb_intern("on_string_literal");
223
+ ripper_id_super = rb_intern("on_super");
224
+ ripper_id_symbol = rb_intern("on_symbol");
225
+ ripper_id_symbol_literal = rb_intern("on_symbol_literal");
226
+ ripper_id_topconst_field = rb_intern("on_topconst_field");
227
+ ripper_id_topconst_ref = rb_intern("on_topconst_ref");
228
+ ripper_id_unary = rb_intern("on_unary");
229
+ ripper_id_undef = rb_intern("on_undef");
230
+ ripper_id_unless = rb_intern("on_unless");
231
+ ripper_id_unless_mod = rb_intern("on_unless_mod");
232
+ ripper_id_until = rb_intern("on_until");
233
+ ripper_id_until_mod = rb_intern("on_until_mod");
234
+ ripper_id_var_alias = rb_intern("on_var_alias");
235
+ ripper_id_var_field = rb_intern("on_var_field");
236
+ ripper_id_var_ref = rb_intern("on_var_ref");
237
+ ripper_id_void_stmt = rb_intern("on_void_stmt");
238
+ ripper_id_when = rb_intern("on_when");
239
+ ripper_id_while = rb_intern("on_while");
240
+ ripper_id_while_mod = rb_intern("on_while_mod");
241
+ ripper_id_word_add = rb_intern("on_word_add");
242
+ ripper_id_word_new = rb_intern("on_word_new");
243
+ ripper_id_words_add = rb_intern("on_words_add");
244
+ ripper_id_words_new = rb_intern("on_words_new");
245
+ ripper_id_xstring_add = rb_intern("on_xstring_add");
246
+ ripper_id_xstring_literal = rb_intern("on_xstring_literal");
247
+ ripper_id_xstring_new = rb_intern("on_xstring_new");
248
+ ripper_id_yield = rb_intern("on_yield");
249
+ ripper_id_yield0 = rb_intern("on_yield0");
250
+ ripper_id_zsuper = rb_intern("on_zsuper");
251
+ }