langscan 1.2-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. data/AUTHORS.txt +19 -0
  2. data/History.txt +126 -0
  3. data/Manifest.txt +167 -0
  4. data/README.rdoc +91 -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 +188 -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 +4629 -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 +188 -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 +2971 -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 +188 -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 +5468 -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 +188 -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 +2108 -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 +188 -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 +2097 -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 +188 -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 +2058 -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 +188 -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 +188 -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 +2413 -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 +188 -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 +2109 -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 +189 -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 +188 -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 +2454 -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 +188 -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 +2477 -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/c/c.so +0 -0
  112. data/lib/langscan/csharp.rb +101 -0
  113. data/lib/langscan/csharp/csharp.so +0 -0
  114. data/lib/langscan/css.rb +109 -0
  115. data/lib/langscan/d.rb +201 -0
  116. data/lib/langscan/d/d.so +0 -0
  117. data/lib/langscan/eiffel.rb +167 -0
  118. data/lib/langscan/elisp.rb +132 -0
  119. data/lib/langscan/elisp/elisp.so +0 -0
  120. data/lib/langscan/io.rb +84 -0
  121. data/lib/langscan/java.rb +95 -0
  122. data/lib/langscan/java/java.so +0 -0
  123. data/lib/langscan/javascript.rb +97 -0
  124. data/lib/langscan/javascript/javascript.so +0 -0
  125. data/lib/langscan/lua.rb +116 -0
  126. data/lib/langscan/ocaml.rb +298 -0
  127. data/lib/langscan/ocaml/camlexer.ml +28 -0
  128. data/lib/langscan/ocaml/lexer.mll +230 -0
  129. data/lib/langscan/ocaml/types.ml +36 -0
  130. data/lib/langscan/pairmatcher/pairmatcher.so +0 -0
  131. data/lib/langscan/perl.rb +87 -0
  132. data/lib/langscan/perl/tokenizer.pl +231 -0
  133. data/lib/langscan/php.rb +80 -0
  134. data/lib/langscan/php/php.so +0 -0
  135. data/lib/langscan/python.rb +101 -0
  136. data/lib/langscan/python/python.so +0 -0
  137. data/lib/langscan/rpmspec.rb +71 -0
  138. data/lib/langscan/ruby.rb +164 -0
  139. data/lib/langscan/ruby/compat/README +5 -0
  140. data/lib/langscan/ruby/compat/ripper.rb +4 -0
  141. data/lib/langscan/ruby/compat/ripper.so +0 -0
  142. data/lib/langscan/ruby/compat/ripper/core.rb +918 -0
  143. data/lib/langscan/ruby/compat/ripper/filter.rb +70 -0
  144. data/lib/langscan/ruby/compat/ripper/lexer.rb +179 -0
  145. data/lib/langscan/ruby/compat/ripper/sexp.rb +100 -0
  146. data/lib/langscan/scheme.rb +160 -0
  147. data/lib/langscan/scheme/scheme.so +0 -0
  148. data/lib/langscan/sh.rb +116 -0
  149. data/lib/langscan/sh/sh.so +0 -0
  150. data/lib/langscan/text.rb +37 -0
  151. data/metaconfig +2 -0
  152. data/script/console +10 -0
  153. data/script/destroy +14 -0
  154. data/script/generate +14 -0
  155. data/script/makemanifest.rb +21 -0
  156. data/setup.rb +1604 -0
  157. data/tasks/extconf.rake +13 -0
  158. data/tasks/extconf/langscan.rake +42 -0
  159. data/test/langscan/brainfuck/test/test_scan.rb +55 -0
  160. data/test/langscan/c/test/test_scan.rb +216 -0
  161. data/test/langscan/c/test/test_token.rb +41 -0
  162. data/test/langscan/csharp/test/test_scan.rb +157 -0
  163. data/test/langscan/css/test/test_css.rb +79 -0
  164. data/test/langscan/d/test/test_scan.rb +233 -0
  165. data/test/langscan/d/test/test_token.rb +205 -0
  166. data/test/langscan/eiffel/test/test_eiffel.rb +95 -0
  167. data/test/langscan/elisp/test/test_elisp.rb +177 -0
  168. data/test/langscan/io/test/test_io.rb +79 -0
  169. data/test/langscan/java/test/test_java.rb +74 -0
  170. data/test/langscan/javascript/test/test_javascript.rb +39 -0
  171. data/test/langscan/lua/test/test_lua.rb +69 -0
  172. data/test/langscan/ocaml/test/test_ocaml.rb +161 -0
  173. data/test/langscan/php/test/test_scan.rb +138 -0
  174. data/test/langscan/python/test/test_scan.rb +105 -0
  175. data/test/langscan/rpmspec/test/test_rpmspec.rb +51 -0
  176. data/test/langscan/ruby/test/test_scan.rb +71 -0
  177. data/test/langscan/scheme/test/test_scan.rb +198 -0
  178. data/test/test_helper.rb +7 -0
  179. data/test/test_langscan.rb +123 -0
  180. metadata +320 -0
@@ -0,0 +1,64 @@
1
+ #ifndef LANGSCAN_JAVA_H
2
+ #define LANGSCAN_JAVA_H
3
+
4
+ #define LANGSCAN_JAVA_TOKEN_LIST \
5
+ LANGSCAN_JAVA_TOKEN(preproc_beg) \
6
+ LANGSCAN_JAVA_TOKEN(preproc_end) \
7
+ LANGSCAN_JAVA_TOKEN(character) \
8
+ LANGSCAN_JAVA_TOKEN(integer) \
9
+ LANGSCAN_JAVA_TOKEN(floating) \
10
+ LANGSCAN_JAVA_TOKEN(string) \
11
+ LANGSCAN_JAVA_TOKEN(ident) \
12
+ LANGSCAN_JAVA_TOKEN(punct) \
13
+ LANGSCAN_JAVA_TOKEN(comment) \
14
+ LANGSCAN_JAVA_TOKEN(space) \
15
+ LANGSCAN_JAVA_TOKEN(classdef)
16
+
17
+ typedef enum {
18
+ langscan_java_eof = 0,
19
+ #define LANGSCAN_JAVA_TOKEN(name) langscan_java_##name,
20
+ LANGSCAN_JAVA_TOKEN_LIST
21
+ #undef LANGSCAN_JAVA_TOKEN
22
+ } langscan_java_token_t;
23
+
24
+ typedef struct {
25
+ int beg_lineno;
26
+ int beg_columnno;
27
+ int beg_byteno;
28
+ int end_lineno;
29
+ int end_columnno;
30
+ int end_byteno;
31
+ int eof;
32
+ char *text;
33
+ int leng;
34
+ size_t (*user_read)(void **user_data_p, char *buf, size_t maxlen);
35
+ void *user_data;
36
+ } langscan_java_lex_extra_t;
37
+
38
+ typedef struct langscan_java_tokenizer_tag {
39
+ langscan_java_lex_extra_t *extra;
40
+ void *scanner;
41
+ } langscan_java_tokenizer_t;
42
+
43
+ typedef size_t (*user_read_t)(void **user_data_p, char *buf, size_t maxlen);
44
+
45
+ langscan_java_tokenizer_t *langscan_java_make_tokenizer(user_read_t user_read, void *user_data);
46
+ langscan_java_token_t langscan_java_get_token(langscan_java_tokenizer_t *tokenizer);
47
+ void langscan_java_free_tokenizer(langscan_java_tokenizer_t *tokenizer);
48
+
49
+ user_read_t langscan_java_tokenizer_get_user_read(langscan_java_tokenizer_t *tokenizer);
50
+ void *langscan_java_tokenizer_get_user_data(langscan_java_tokenizer_t *tokenizer);
51
+
52
+ const char *langscan_java_token_name(langscan_java_token_t token);
53
+ #define langscan_java_curtoken_beg_lineno(tokenizer) ((tokenizer)->extra->beg_lineno)
54
+ #define langscan_java_curtoken_beg_columnno(tokenizer) ((tokenizer)->extra->beg_columnno)
55
+ #define langscan_java_curtoken_beg_byteno(tokenizer) ((tokenizer)->extra->beg_byteno)
56
+ #define langscan_java_curtoken_end_lineno(tokenizer) ((tokenizer)->extra->end_lineno)
57
+ #define langscan_java_curtoken_end_columnno(tokenizer) ((tokenizer)->extra->end_columnno)
58
+ #define langscan_java_curtoken_end_byteno(tokenizer) ((tokenizer)->extra->end_byteno)
59
+ #define langscan_java_curtoken_text(tokenizer) ((tokenizer)->extra->text)
60
+ #define langscan_java_curtoken_leng(tokenizer) ((tokenizer)->extra->leng)
61
+
62
+ void langscan_java_extract_functions(langscan_java_tokenizer_t *);
63
+
64
+ #endif
@@ -0,0 +1,2097 @@
1
+
2
+ #line 3 "<stdout>"
3
+
4
+ #define YY_INT_ALIGNED short int
5
+
6
+ /* A lexical scanner generated by flex */
7
+
8
+ #define FLEX_SCANNER
9
+ #define YY_FLEX_MAJOR_VERSION 2
10
+ #define YY_FLEX_MINOR_VERSION 5
11
+ #define YY_FLEX_SUBMINOR_VERSION 35
12
+ #if YY_FLEX_SUBMINOR_VERSION > 0
13
+ #define FLEX_BETA
14
+ #endif
15
+
16
+ /* First, we deal with platform-specific or compiler-specific issues. */
17
+
18
+ /* begin standard C headers. */
19
+ #include <stdio.h>
20
+ #include <string.h>
21
+ #include <errno.h>
22
+ #include <stdlib.h>
23
+
24
+ /* end standard C headers. */
25
+
26
+ /* flex integer type definitions */
27
+
28
+ #ifndef FLEXINT_H
29
+ #define FLEXINT_H
30
+
31
+ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
+
33
+ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
+
35
+ /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36
+ * if you want the limit (max/min) macros for int types.
37
+ */
38
+ #ifndef __STDC_LIMIT_MACROS
39
+ #define __STDC_LIMIT_MACROS 1
40
+ #endif
41
+
42
+ #include <inttypes.h>
43
+ typedef int8_t flex_int8_t;
44
+ typedef uint8_t flex_uint8_t;
45
+ typedef int16_t flex_int16_t;
46
+ typedef uint16_t flex_uint16_t;
47
+ typedef int32_t flex_int32_t;
48
+ typedef uint32_t flex_uint32_t;
49
+ #else
50
+ typedef signed char flex_int8_t;
51
+ typedef short int flex_int16_t;
52
+ typedef int flex_int32_t;
53
+ typedef unsigned char flex_uint8_t;
54
+ typedef unsigned short int flex_uint16_t;
55
+ typedef unsigned int flex_uint32_t;
56
+
57
+ /* Limits of integral types. */
58
+ #ifndef INT8_MIN
59
+ #define INT8_MIN (-128)
60
+ #endif
61
+ #ifndef INT16_MIN
62
+ #define INT16_MIN (-32767-1)
63
+ #endif
64
+ #ifndef INT32_MIN
65
+ #define INT32_MIN (-2147483647-1)
66
+ #endif
67
+ #ifndef INT8_MAX
68
+ #define INT8_MAX (127)
69
+ #endif
70
+ #ifndef INT16_MAX
71
+ #define INT16_MAX (32767)
72
+ #endif
73
+ #ifndef INT32_MAX
74
+ #define INT32_MAX (2147483647)
75
+ #endif
76
+ #ifndef UINT8_MAX
77
+ #define UINT8_MAX (255U)
78
+ #endif
79
+ #ifndef UINT16_MAX
80
+ #define UINT16_MAX (65535U)
81
+ #endif
82
+ #ifndef UINT32_MAX
83
+ #define UINT32_MAX (4294967295U)
84
+ #endif
85
+
86
+ #endif /* ! C99 */
87
+
88
+ #endif /* ! FLEXINT_H */
89
+
90
+ #ifdef __cplusplus
91
+
92
+ /* The "const" storage-class-modifier is valid. */
93
+ #define YY_USE_CONST
94
+
95
+ #else /* ! __cplusplus */
96
+
97
+ /* C99 requires __STDC__ to be defined as 1. */
98
+ #if defined (__STDC__)
99
+
100
+ #define YY_USE_CONST
101
+
102
+ #endif /* defined (__STDC__) */
103
+ #endif /* ! __cplusplus */
104
+
105
+ #ifdef YY_USE_CONST
106
+ #define yyconst const
107
+ #else
108
+ #define yyconst
109
+ #endif
110
+
111
+ /* Returned upon end-of-file. */
112
+ #define YY_NULL 0
113
+
114
+ /* Promotes a possibly negative, possibly signed char to an unsigned
115
+ * integer for use as an array index. If the signed char is negative,
116
+ * we want to instead treat it as an 8-bit unsigned char, hence the
117
+ * double cast.
118
+ */
119
+ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
+
121
+ /* An opaque pointer. */
122
+ #ifndef YY_TYPEDEF_YY_SCANNER_T
123
+ #define YY_TYPEDEF_YY_SCANNER_T
124
+ typedef void* yyscan_t;
125
+ #endif
126
+
127
+ /* For convenience, these vars (plus the bison vars far below)
128
+ are macros in the reentrant scanner. */
129
+ #define yyin yyg->yyin_r
130
+ #define yyout yyg->yyout_r
131
+ #define yyextra yyg->yyextra_r
132
+ #define yyleng yyg->yyleng_r
133
+ #define yytext yyg->yytext_r
134
+ #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
135
+ #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
136
+ #define yy_flex_debug yyg->yy_flex_debug_r
137
+
138
+ /* Enter a start condition. This macro really ought to take a parameter,
139
+ * but we do it the disgusting crufty way forced on us by the ()-less
140
+ * definition of BEGIN.
141
+ */
142
+ #define BEGIN yyg->yy_start = 1 + 2 *
143
+
144
+ /* Translate the current start state into a value that can be later handed
145
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
146
+ * compatibility.
147
+ */
148
+ #define YY_START ((yyg->yy_start - 1) / 2)
149
+ #define YYSTATE YY_START
150
+
151
+ /* Action number for EOF rule of a given start state. */
152
+ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
153
+
154
+ /* Special action meaning "start processing a new file". */
155
+ #define YY_NEW_FILE langscan_java_lex_restart(yyin ,yyscanner )
156
+
157
+ #define YY_END_OF_BUFFER_CHAR 0
158
+
159
+ /* Size of default input buffer. */
160
+ #ifndef YY_BUF_SIZE
161
+ #ifdef __ia64__
162
+ /* On IA-64, the buffer size is 16k, not 8k.
163
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
164
+ * Ditto for the __ia64__ case accordingly.
165
+ */
166
+ #define YY_BUF_SIZE 32768
167
+ #else
168
+ #define YY_BUF_SIZE 16384
169
+ #endif /* __ia64__ */
170
+ #endif
171
+
172
+ /* The state buf must be large enough to hold one state per character in the main buffer.
173
+ */
174
+ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
175
+
176
+ #ifndef YY_TYPEDEF_YY_BUFFER_STATE
177
+ #define YY_TYPEDEF_YY_BUFFER_STATE
178
+ typedef struct yy_buffer_state *YY_BUFFER_STATE;
179
+ #endif
180
+
181
+ #define EOB_ACT_CONTINUE_SCAN 0
182
+ #define EOB_ACT_END_OF_FILE 1
183
+ #define EOB_ACT_LAST_MATCH 2
184
+
185
+ #define YY_LESS_LINENO(n)
186
+
187
+ /* Return all but the first "n" matched characters back to the input stream. */
188
+ #define yyless(n) \
189
+ do \
190
+ { \
191
+ /* Undo effects of setting up yytext. */ \
192
+ int yyless_macro_arg = (n); \
193
+ YY_LESS_LINENO(yyless_macro_arg);\
194
+ *yy_cp = yyg->yy_hold_char; \
195
+ YY_RESTORE_YY_MORE_OFFSET \
196
+ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
197
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
198
+ } \
199
+ while ( 0 )
200
+
201
+ #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
202
+
203
+ #ifndef YY_TYPEDEF_YY_SIZE_T
204
+ #define YY_TYPEDEF_YY_SIZE_T
205
+ typedef size_t yy_size_t;
206
+ #endif
207
+
208
+ #ifndef YY_STRUCT_YY_BUFFER_STATE
209
+ #define YY_STRUCT_YY_BUFFER_STATE
210
+ struct yy_buffer_state
211
+ {
212
+ FILE *yy_input_file;
213
+
214
+ char *yy_ch_buf; /* input buffer */
215
+ char *yy_buf_pos; /* current position in input buffer */
216
+
217
+ /* Size of input buffer in bytes, not including room for EOB
218
+ * characters.
219
+ */
220
+ yy_size_t yy_buf_size;
221
+
222
+ /* Number of characters read into yy_ch_buf, not including EOB
223
+ * characters.
224
+ */
225
+ int yy_n_chars;
226
+
227
+ /* Whether we "own" the buffer - i.e., we know we created it,
228
+ * and can realloc() it to grow it, and should free() it to
229
+ * delete it.
230
+ */
231
+ int yy_is_our_buffer;
232
+
233
+ /* Whether this is an "interactive" input source; if so, and
234
+ * if we're using stdio for input, then we want to use getc()
235
+ * instead of fread(), to make sure we stop fetching input after
236
+ * each newline.
237
+ */
238
+ int yy_is_interactive;
239
+
240
+ /* Whether we're considered to be at the beginning of a line.
241
+ * If so, '^' rules will be active on the next match, otherwise
242
+ * not.
243
+ */
244
+ int yy_at_bol;
245
+
246
+ int yy_bs_lineno; /**< The line count. */
247
+ int yy_bs_column; /**< The column count. */
248
+
249
+ /* Whether to try to fill the input buffer when we reach the
250
+ * end of it.
251
+ */
252
+ int yy_fill_buffer;
253
+
254
+ int yy_buffer_status;
255
+
256
+ #define YY_BUFFER_NEW 0
257
+ #define YY_BUFFER_NORMAL 1
258
+ /* When an EOF's been seen but there's still some text to process
259
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
260
+ * shouldn't try reading from the input source any more. We might
261
+ * still have a bunch of tokens to match, though, because of
262
+ * possible backing-up.
263
+ *
264
+ * When we actually see the EOF, we change the status to "new"
265
+ * (via langscan_java_lex_restart()), so that the user can continue scanning by
266
+ * just pointing yyin at a new input file.
267
+ */
268
+ #define YY_BUFFER_EOF_PENDING 2
269
+
270
+ };
271
+ #endif /* !YY_STRUCT_YY_BUFFER_STATE */
272
+
273
+ /* We provide macros for accessing buffer states in case in the
274
+ * future we want to put the buffer states in a more general
275
+ * "scanner state".
276
+ *
277
+ * Returns the top of the stack, or NULL.
278
+ */
279
+ #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
280
+ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
281
+ : NULL)
282
+
283
+ /* Same as previous macro, but useful when we know that the buffer stack is not
284
+ * NULL or when we need an lvalue. For internal use only.
285
+ */
286
+ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
287
+
288
+ void langscan_java_lex_restart (FILE *input_file ,yyscan_t yyscanner );
289
+ void langscan_java_lex__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
290
+ YY_BUFFER_STATE langscan_java_lex__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
291
+ void langscan_java_lex__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
292
+ void langscan_java_lex__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
293
+ void langscan_java_lex_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
294
+ void langscan_java_lex_pop_buffer_state (yyscan_t yyscanner );
295
+
296
+ static void langscan_java_lex_ensure_buffer_stack (yyscan_t yyscanner );
297
+ static void langscan_java_lex__load_buffer_state (yyscan_t yyscanner );
298
+ static void langscan_java_lex__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
299
+
300
+ #define YY_FLUSH_BUFFER langscan_java_lex__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
301
+
302
+ YY_BUFFER_STATE langscan_java_lex__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
303
+ YY_BUFFER_STATE langscan_java_lex__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
304
+ YY_BUFFER_STATE langscan_java_lex__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
305
+
306
+ void *langscan_java_lex_alloc (yy_size_t ,yyscan_t yyscanner );
307
+ void *langscan_java_lex_realloc (void *,yy_size_t ,yyscan_t yyscanner );
308
+ void langscan_java_lex_free (void * ,yyscan_t yyscanner );
309
+
310
+ #define yy_new_buffer langscan_java_lex__create_buffer
311
+
312
+ #define yy_set_interactive(is_interactive) \
313
+ { \
314
+ if ( ! YY_CURRENT_BUFFER ){ \
315
+ langscan_java_lex_ensure_buffer_stack (yyscanner); \
316
+ YY_CURRENT_BUFFER_LVALUE = \
317
+ langscan_java_lex__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
318
+ } \
319
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
320
+ }
321
+
322
+ #define yy_set_bol(at_bol) \
323
+ { \
324
+ if ( ! YY_CURRENT_BUFFER ){\
325
+ langscan_java_lex_ensure_buffer_stack (yyscanner); \
326
+ YY_CURRENT_BUFFER_LVALUE = \
327
+ langscan_java_lex__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
328
+ } \
329
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
330
+ }
331
+
332
+ #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
333
+
334
+ /* Begin user sect3 */
335
+
336
+ #define langscan_java_lex_wrap(n) 1
337
+ #define YY_SKIP_YYWRAP
338
+
339
+ typedef unsigned char YY_CHAR;
340
+
341
+ typedef int yy_state_type;
342
+
343
+ #define yytext_ptr yytext_r
344
+
345
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
346
+ static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
347
+ static int yy_get_next_buffer (yyscan_t yyscanner );
348
+ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
349
+
350
+ /* Done after the current pattern has been matched and before the
351
+ * corresponding action - sets up yytext.
352
+ */
353
+ #define YY_DO_BEFORE_ACTION \
354
+ yyg->yytext_ptr = yy_bp; \
355
+ yyleng = (size_t) (yy_cp - yy_bp); \
356
+ yyg->yy_hold_char = *yy_cp; \
357
+ *yy_cp = '\0'; \
358
+ yyg->yy_c_buf_p = yy_cp;
359
+
360
+ #define YY_NUM_RULES 10
361
+ #define YY_END_OF_BUFFER 11
362
+ /* This struct is not used in this scanner,
363
+ but its presence is necessary. */
364
+ struct yy_trans_info
365
+ {
366
+ flex_int32_t yy_verify;
367
+ flex_int32_t yy_nxt;
368
+ };
369
+ static yyconst flex_int16_t yy_accept[47] =
370
+ { 0,
371
+ 0, 0, 0, 0, 11, 9, 3, 4, 9, 9,
372
+ 8, 8, 2, 2, 3, 0, 7, 0, 0, 5,
373
+ 8, 8, 2, 2, 0, 0, 5, 8, 2, 0,
374
+ 6, 8, 2, 0, 8, 2, 0, 0, 1, 0,
375
+ 1, 0, 0, 0, 0, 0
376
+ } ;
377
+
378
+ static yyconst flex_int32_t yy_ec[256] =
379
+ { 0,
380
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
381
+ 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
382
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383
+ 1, 2, 1, 4, 1, 1, 1, 1, 1, 1,
384
+ 1, 5, 1, 1, 1, 1, 6, 7, 7, 7,
385
+ 7, 7, 7, 7, 7, 7, 7, 1, 1, 1,
386
+ 1, 1, 1, 1, 8, 8, 8, 8, 8, 8,
387
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
388
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
389
+ 1, 9, 1, 1, 8, 1, 10, 8, 11, 8,
390
+
391
+ 8, 8, 8, 8, 8, 8, 8, 12, 8, 8,
392
+ 8, 8, 8, 8, 13, 8, 8, 8, 8, 8,
393
+ 8, 8, 1, 1, 1, 1, 1, 1, 1, 1,
394
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401
+
402
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407
+ 1, 1, 1, 1, 1
408
+ } ;
409
+
410
+ static yyconst flex_int32_t yy_meta[14] =
411
+ { 0,
412
+ 1, 2, 3, 1, 1, 2, 4, 5, 1, 5,
413
+ 5, 5, 5
414
+ } ;
415
+
416
+ static yyconst flex_int16_t yy_base[59] =
417
+ { 0,
418
+ 0, 0, 6, 0, 106, 107, 103, 107, 16, 21,
419
+ 0, 92, 0, 91, 82, 24, 107, 66, 44, 0,
420
+ 0, 38, 0, 34, 38, 29, 0, 26, 25, 27,
421
+ 107, 18, 17, 24, 34, 39, 44, 19, 0, 18,
422
+ 0, 17, 46, 16, 10, 107, 52, 54, 56, 61,
423
+ 66, 71, 76, 80, 82, 87, 92, 97
424
+ } ;
425
+
426
+ static yyconst flex_int16_t yy_def[59] =
427
+ { 0,
428
+ 46, 1, 1, 3, 46, 46, 46, 46, 47, 46,
429
+ 48, 48, 49, 49, 46, 47, 46, 47, 50, 51,
430
+ 48, 48, 49, 49, 50, 52, 51, 48, 49, 53,
431
+ 46, 48, 49, 53, 48, 49, 54, 46, 55, 56,
432
+ 55, 56, 57, 58, 58, 0, 46, 46, 46, 46,
433
+ 46, 46, 46, 46, 46, 46, 46, 46
434
+ } ;
435
+
436
+ static yyconst flex_int16_t yy_nxt[121] =
437
+ { 0,
438
+ 6, 7, 8, 9, 6, 10, 6, 11, 6, 11,
439
+ 12, 11, 11, 13, 43, 13, 14, 13, 13, 17,
440
+ 43, 43, 43, 40, 18, 19, 20, 17, 26, 36,
441
+ 35, 26, 18, 26, 31, 37, 37, 33, 32, 38,
442
+ 37, 37, 26, 29, 38, 37, 37, 28, 26, 38,
443
+ 43, 37, 16, 16, 16, 16, 16, 21, 21, 23,
444
+ 23, 25, 25, 25, 25, 25, 27, 27, 46, 27,
445
+ 27, 30, 30, 30, 30, 30, 34, 34, 34, 34,
446
+ 34, 39, 39, 15, 39, 41, 41, 42, 42, 42,
447
+ 42, 42, 44, 44, 44, 44, 44, 45, 45, 45,
448
+
449
+ 45, 45, 24, 22, 15, 46, 5, 46, 46, 46,
450
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46
451
+ } ;
452
+
453
+ static yyconst flex_int16_t yy_chk[121] =
454
+ { 0,
455
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
456
+ 1, 1, 1, 3, 45, 3, 3, 3, 3, 9,
457
+ 44, 42, 40, 38, 9, 10, 10, 16, 34, 33,
458
+ 32, 30, 16, 26, 26, 35, 35, 29, 28, 35,
459
+ 36, 36, 25, 24, 36, 37, 37, 22, 19, 37,
460
+ 43, 43, 47, 47, 47, 47, 47, 48, 48, 49,
461
+ 49, 50, 50, 50, 50, 50, 51, 51, 18, 51,
462
+ 51, 52, 52, 52, 52, 52, 53, 53, 53, 53,
463
+ 53, 54, 54, 15, 54, 55, 55, 56, 56, 56,
464
+ 56, 56, 57, 57, 57, 57, 57, 58, 58, 58,
465
+
466
+ 58, 58, 14, 12, 7, 5, 46, 46, 46, 46,
467
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46
468
+ } ;
469
+
470
+ /* The intent behind this definition is that it'll catch
471
+ * any uses of REJECT which flex missed.
472
+ */
473
+ #define REJECT reject_used_but_not_detected
474
+ #define yymore() yymore_used_but_not_detected
475
+ #define YY_MORE_ADJ 0
476
+ #define YY_RESTORE_YY_MORE_OFFSET
477
+ /*
478
+ * java.l - a lex rule for Java
479
+ *
480
+ * Copyright (C) 2005 Keisuke Nishida <knishida@open-cobol.org>
481
+ * All rights reserved.
482
+ * This is free software with ABSOLUTELY NO WARRANTY.
483
+ *
484
+ * You can redistribute it and/or modify it under the terms of
485
+ * the GNU General Public License version 2.
486
+ */
487
+
488
+ #include "java.h"
489
+
490
+ #define YY_EXTRA_TYPE langscan_java_lex_extra_t *
491
+
492
+ #if YY_NULL != 0
493
+ #error "YY_NULL is not 0."
494
+ #endif
495
+
496
+ #define YY_DECL langscan_java_token_t langscan_java_lex_lex(yyscan_t yyscanner)
497
+
498
+ #define YY_INPUT(buf,result,max_size) \
499
+ if (!yyextra->eof) { \
500
+ result = yyextra->user_read(&(yyextra->user_data), (buf), (max_size)); \
501
+ if (result == 0) \
502
+ yyextra->eof = 1; \
503
+ }
504
+
505
+ #define UPD update_pos(yyextra, yytext, yyleng)
506
+ static void update_pos(langscan_java_lex_extra_t *, char *, int);
507
+
508
+ #define report(token) \
509
+ do { \
510
+ yyextra->text = yytext; \
511
+ yyextra->leng = yyleng; \
512
+ return langscan_java_##token; \
513
+ } while (0)
514
+
515
+ #define INITIAL 0
516
+ #define CLASSDEF 1
517
+
518
+ #ifndef YY_EXTRA_TYPE
519
+ #define YY_EXTRA_TYPE void *
520
+ #endif
521
+
522
+ /* Holds the entire state of the reentrant scanner. */
523
+ struct yyguts_t
524
+ {
525
+
526
+ /* User-defined. Not touched by flex. */
527
+ YY_EXTRA_TYPE yyextra_r;
528
+
529
+ /* The rest are the same as the globals declared in the non-reentrant scanner. */
530
+ FILE *yyin_r, *yyout_r;
531
+ size_t yy_buffer_stack_top; /**< index of top of stack. */
532
+ size_t yy_buffer_stack_max; /**< capacity of stack. */
533
+ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
534
+ char yy_hold_char;
535
+ int yy_n_chars;
536
+ int yyleng_r;
537
+ char *yy_c_buf_p;
538
+ int yy_init;
539
+ int yy_start;
540
+ int yy_did_buffer_switch_on_eof;
541
+ int yy_start_stack_ptr;
542
+ int yy_start_stack_depth;
543
+ int *yy_start_stack;
544
+ yy_state_type yy_last_accepting_state;
545
+ char* yy_last_accepting_cpos;
546
+
547
+ int yylineno_r;
548
+ int yy_flex_debug_r;
549
+
550
+ char *yytext_r;
551
+ int yy_more_flag;
552
+ int yy_more_len;
553
+
554
+ }; /* end struct yyguts_t */
555
+
556
+ static int yy_init_globals (yyscan_t yyscanner );
557
+
558
+ int langscan_java_lex_lex_init (yyscan_t* scanner);
559
+
560
+ int langscan_java_lex_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
561
+
562
+ /* Accessor methods to globals.
563
+ These are made visible to non-reentrant scanners for convenience. */
564
+
565
+ int langscan_java_lex_lex_destroy (yyscan_t yyscanner );
566
+
567
+ int langscan_java_lex_get_debug (yyscan_t yyscanner );
568
+
569
+ void langscan_java_lex_set_debug (int debug_flag ,yyscan_t yyscanner );
570
+
571
+ YY_EXTRA_TYPE langscan_java_lex_get_extra (yyscan_t yyscanner );
572
+
573
+ void langscan_java_lex_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
574
+
575
+ FILE *langscan_java_lex_get_in (yyscan_t yyscanner );
576
+
577
+ void langscan_java_lex_set_in (FILE * in_str ,yyscan_t yyscanner );
578
+
579
+ FILE *langscan_java_lex_get_out (yyscan_t yyscanner );
580
+
581
+ void langscan_java_lex_set_out (FILE * out_str ,yyscan_t yyscanner );
582
+
583
+ int langscan_java_lex_get_leng (yyscan_t yyscanner );
584
+
585
+ char *langscan_java_lex_get_text (yyscan_t yyscanner );
586
+
587
+ int langscan_java_lex_get_lineno (yyscan_t yyscanner );
588
+
589
+ void langscan_java_lex_set_lineno (int line_number ,yyscan_t yyscanner );
590
+
591
+ /* Macros after this point can all be overridden by user definitions in
592
+ * section 1.
593
+ */
594
+
595
+ #ifndef YY_SKIP_YYWRAP
596
+ #ifdef __cplusplus
597
+ extern "C" int langscan_java_lex_wrap (yyscan_t yyscanner );
598
+ #else
599
+ extern int langscan_java_lex_wrap (yyscan_t yyscanner );
600
+ #endif
601
+ #endif
602
+
603
+ static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
604
+
605
+ #ifndef yytext_ptr
606
+ static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
607
+ #endif
608
+
609
+ #ifdef YY_NEED_STRLEN
610
+ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
611
+ #endif
612
+
613
+ #ifndef YY_NO_INPUT
614
+
615
+ #ifdef __cplusplus
616
+ static int yyinput (yyscan_t yyscanner );
617
+ #else
618
+ static int input (yyscan_t yyscanner );
619
+ #endif
620
+
621
+ #endif
622
+
623
+ /* Amount of stuff to slurp up with each read. */
624
+ #ifndef YY_READ_BUF_SIZE
625
+ #ifdef __ia64__
626
+ /* On IA-64, the buffer size is 16k, not 8k */
627
+ #define YY_READ_BUF_SIZE 16384
628
+ #else
629
+ #define YY_READ_BUF_SIZE 8192
630
+ #endif /* __ia64__ */
631
+ #endif
632
+
633
+ /* Copy whatever the last rule matched to the standard output. */
634
+ #ifndef ECHO
635
+ /* This used to be an fputs(), but since the string might contain NUL's,
636
+ * we now use fwrite().
637
+ */
638
+ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
639
+ #endif
640
+
641
+ /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
642
+ * is returned in "result".
643
+ */
644
+ #ifndef YY_INPUT
645
+ #define YY_INPUT(buf,result,max_size) \
646
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
647
+ { \
648
+ int c = '*'; \
649
+ size_t n; \
650
+ for ( n = 0; n < max_size && \
651
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
652
+ buf[n] = (char) c; \
653
+ if ( c == '\n' ) \
654
+ buf[n++] = (char) c; \
655
+ if ( c == EOF && ferror( yyin ) ) \
656
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
657
+ result = n; \
658
+ } \
659
+ else \
660
+ { \
661
+ errno=0; \
662
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
663
+ { \
664
+ if( errno != EINTR) \
665
+ { \
666
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
667
+ break; \
668
+ } \
669
+ errno=0; \
670
+ clearerr(yyin); \
671
+ } \
672
+ }\
673
+ \
674
+
675
+ #endif
676
+
677
+ /* No semi-colon after return; correct usage is to write "yyterminate();" -
678
+ * we don't want an extra ';' after the "return" because that will cause
679
+ * some compilers to complain about unreachable statements.
680
+ */
681
+ #ifndef yyterminate
682
+ #define yyterminate() return YY_NULL
683
+ #endif
684
+
685
+ /* Number of entries by which start-condition stack grows. */
686
+ #ifndef YY_START_STACK_INCR
687
+ #define YY_START_STACK_INCR 25
688
+ #endif
689
+
690
+ /* Report a fatal error. */
691
+ #ifndef YY_FATAL_ERROR
692
+ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
693
+ #endif
694
+
695
+ /* end tables serialization structures and prototypes */
696
+
697
+ /* Default declaration of generated scanner - a define so the user can
698
+ * easily add parameters.
699
+ */
700
+ #ifndef YY_DECL
701
+ #define YY_DECL_IS_OURS 1
702
+
703
+ extern int langscan_java_lex_lex (yyscan_t yyscanner);
704
+
705
+ #define YY_DECL int langscan_java_lex_lex (yyscan_t yyscanner)
706
+ #endif /* !YY_DECL */
707
+
708
+ /* Code executed at the beginning of each rule, after yytext and yyleng
709
+ * have been set up.
710
+ */
711
+ #ifndef YY_USER_ACTION
712
+ #define YY_USER_ACTION
713
+ #endif
714
+
715
+ /* Code executed at the end of each rule. */
716
+ #ifndef YY_BREAK
717
+ #define YY_BREAK break;
718
+ #endif
719
+
720
+ #define YY_RULE_SETUP \
721
+ YY_USER_ACTION
722
+
723
+ /** The main scanner function which does all the work.
724
+ */
725
+ YY_DECL
726
+ {
727
+ register yy_state_type yy_current_state;
728
+ register char *yy_cp, *yy_bp;
729
+ register int yy_act;
730
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
731
+
732
+ if ( !yyg->yy_init )
733
+ {
734
+ yyg->yy_init = 1;
735
+
736
+ #ifdef YY_USER_INIT
737
+ YY_USER_INIT;
738
+ #endif
739
+
740
+ if ( ! yyg->yy_start )
741
+ yyg->yy_start = 1; /* first start state */
742
+
743
+ if ( ! yyin )
744
+ yyin = stdin;
745
+
746
+ if ( ! yyout )
747
+ yyout = stdout;
748
+
749
+ if ( ! YY_CURRENT_BUFFER ) {
750
+ langscan_java_lex_ensure_buffer_stack (yyscanner);
751
+ YY_CURRENT_BUFFER_LVALUE =
752
+ langscan_java_lex__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
753
+ }
754
+
755
+ langscan_java_lex__load_buffer_state(yyscanner );
756
+ }
757
+
758
+ while ( 1 ) /* loops until end-of-file is reached */
759
+ {
760
+ yy_cp = yyg->yy_c_buf_p;
761
+
762
+ /* Support of yytext. */
763
+ *yy_cp = yyg->yy_hold_char;
764
+
765
+ /* yy_bp points to the position in yy_ch_buf of the start of
766
+ * the current run.
767
+ */
768
+ yy_bp = yy_cp;
769
+
770
+ yy_current_state = yyg->yy_start;
771
+ yy_match:
772
+ do
773
+ {
774
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
775
+ if ( yy_accept[yy_current_state] )
776
+ {
777
+ yyg->yy_last_accepting_state = yy_current_state;
778
+ yyg->yy_last_accepting_cpos = yy_cp;
779
+ }
780
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
781
+ {
782
+ yy_current_state = (int) yy_def[yy_current_state];
783
+ if ( yy_current_state >= 47 )
784
+ yy_c = yy_meta[(unsigned int) yy_c];
785
+ }
786
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
787
+ ++yy_cp;
788
+ }
789
+ while ( yy_base[yy_current_state] != 107 );
790
+
791
+ yy_find_action:
792
+ yy_act = yy_accept[yy_current_state];
793
+ if ( yy_act == 0 )
794
+ { /* have to back up */
795
+ yy_cp = yyg->yy_last_accepting_cpos;
796
+ yy_current_state = yyg->yy_last_accepting_state;
797
+ yy_act = yy_accept[yy_current_state];
798
+ }
799
+
800
+ YY_DO_BEFORE_ACTION;
801
+
802
+ do_action: /* This label is used only to access EOF actions. */
803
+
804
+ switch ( yy_act )
805
+ { /* beginning of action switch */
806
+ case 0: /* must back up */
807
+ /* undo the effects of YY_DO_BEFORE_ACTION */
808
+ *yy_cp = yyg->yy_hold_char;
809
+ yy_cp = yyg->yy_last_accepting_cpos;
810
+ yy_current_state = yyg->yy_last_accepting_state;
811
+ goto yy_find_action;
812
+
813
+ case 1:
814
+ /* rule 1 can match eol */
815
+ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
816
+ yyg->yy_c_buf_p = yy_cp = yy_bp + 5;
817
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
818
+ YY_RULE_SETUP
819
+ { UPD; BEGIN(CLASSDEF); report(ident); }
820
+ YY_BREAK
821
+ case 2:
822
+ YY_RULE_SETUP
823
+ { UPD; BEGIN(INITIAL); report(classdef); }
824
+ YY_BREAK
825
+ case 3:
826
+ YY_RULE_SETUP
827
+ { UPD; report(space); }
828
+ YY_BREAK
829
+ case 4:
830
+ /* rule 4 can match eol */
831
+ YY_RULE_SETUP
832
+ { UPD; report(space); }
833
+ YY_BREAK
834
+ case 5:
835
+ YY_RULE_SETUP
836
+ { UPD; report(comment); }
837
+ YY_BREAK
838
+ case 6:
839
+ /* rule 6 can match eol */
840
+ YY_RULE_SETUP
841
+ { UPD; report(comment); }
842
+ YY_BREAK
843
+ case 7:
844
+ /* rule 7 can match eol */
845
+ YY_RULE_SETUP
846
+ { UPD; report(string); }
847
+ YY_BREAK
848
+ case 8:
849
+ YY_RULE_SETUP
850
+ { UPD; report(ident); }
851
+ YY_BREAK
852
+ case 9:
853
+ YY_RULE_SETUP
854
+ { UPD; report(punct); }
855
+ YY_BREAK
856
+ case 10:
857
+ YY_RULE_SETUP
858
+ YY_FATAL_ERROR( "flex scanner jammed" );
859
+ YY_BREAK
860
+ case YY_STATE_EOF(INITIAL):
861
+ case YY_STATE_EOF(CLASSDEF):
862
+ yyterminate();
863
+
864
+ case YY_END_OF_BUFFER:
865
+ {
866
+ /* Amount of text matched not including the EOB char. */
867
+ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
868
+
869
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
870
+ *yy_cp = yyg->yy_hold_char;
871
+ YY_RESTORE_YY_MORE_OFFSET
872
+
873
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
874
+ {
875
+ /* We're scanning a new file or input source. It's
876
+ * possible that this happened because the user
877
+ * just pointed yyin at a new source and called
878
+ * langscan_java_lex_lex(). If so, then we have to assure
879
+ * consistency between YY_CURRENT_BUFFER and our
880
+ * globals. Here is the right place to do so, because
881
+ * this is the first action (other than possibly a
882
+ * back-up) that will match for the new input source.
883
+ */
884
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
885
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
886
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
887
+ }
888
+
889
+ /* Note that here we test for yy_c_buf_p "<=" to the position
890
+ * of the first EOB in the buffer, since yy_c_buf_p will
891
+ * already have been incremented past the NUL character
892
+ * (since all states make transitions on EOB to the
893
+ * end-of-buffer state). Contrast this with the test
894
+ * in input().
895
+ */
896
+ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
897
+ { /* This was really a NUL. */
898
+ yy_state_type yy_next_state;
899
+
900
+ yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
901
+
902
+ yy_current_state = yy_get_previous_state( yyscanner );
903
+
904
+ /* Okay, we're now positioned to make the NUL
905
+ * transition. We couldn't have
906
+ * yy_get_previous_state() go ahead and do it
907
+ * for us because it doesn't know how to deal
908
+ * with the possibility of jamming (and we don't
909
+ * want to build jamming into it because then it
910
+ * will run more slowly).
911
+ */
912
+
913
+ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
914
+
915
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
916
+
917
+ if ( yy_next_state )
918
+ {
919
+ /* Consume the NUL. */
920
+ yy_cp = ++yyg->yy_c_buf_p;
921
+ yy_current_state = yy_next_state;
922
+ goto yy_match;
923
+ }
924
+
925
+ else
926
+ {
927
+ yy_cp = yyg->yy_c_buf_p;
928
+ goto yy_find_action;
929
+ }
930
+ }
931
+
932
+ else switch ( yy_get_next_buffer( yyscanner ) )
933
+ {
934
+ case EOB_ACT_END_OF_FILE:
935
+ {
936
+ yyg->yy_did_buffer_switch_on_eof = 0;
937
+
938
+ if ( langscan_java_lex_wrap(yyscanner ) )
939
+ {
940
+ /* Note: because we've taken care in
941
+ * yy_get_next_buffer() to have set up
942
+ * yytext, we can now set up
943
+ * yy_c_buf_p so that if some total
944
+ * hoser (like flex itself) wants to
945
+ * call the scanner after we return the
946
+ * YY_NULL, it'll still work - another
947
+ * YY_NULL will get returned.
948
+ */
949
+ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
950
+
951
+ yy_act = YY_STATE_EOF(YY_START);
952
+ goto do_action;
953
+ }
954
+
955
+ else
956
+ {
957
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
958
+ YY_NEW_FILE;
959
+ }
960
+ break;
961
+ }
962
+
963
+ case EOB_ACT_CONTINUE_SCAN:
964
+ yyg->yy_c_buf_p =
965
+ yyg->yytext_ptr + yy_amount_of_matched_text;
966
+
967
+ yy_current_state = yy_get_previous_state( yyscanner );
968
+
969
+ yy_cp = yyg->yy_c_buf_p;
970
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
971
+ goto yy_match;
972
+
973
+ case EOB_ACT_LAST_MATCH:
974
+ yyg->yy_c_buf_p =
975
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
976
+
977
+ yy_current_state = yy_get_previous_state( yyscanner );
978
+
979
+ yy_cp = yyg->yy_c_buf_p;
980
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
981
+ goto yy_find_action;
982
+ }
983
+ break;
984
+ }
985
+
986
+ default:
987
+ YY_FATAL_ERROR(
988
+ "fatal flex scanner internal error--no action found" );
989
+ } /* end of action switch */
990
+ } /* end of scanning one token */
991
+ } /* end of langscan_java_lex_lex */
992
+
993
+ /* yy_get_next_buffer - try to read in a new buffer
994
+ *
995
+ * Returns a code representing an action:
996
+ * EOB_ACT_LAST_MATCH -
997
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
998
+ * EOB_ACT_END_OF_FILE - end of file
999
+ */
1000
+ static int yy_get_next_buffer (yyscan_t yyscanner)
1001
+ {
1002
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1003
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1004
+ register char *source = yyg->yytext_ptr;
1005
+ register int number_to_move, i;
1006
+ int ret_val;
1007
+
1008
+ if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1009
+ YY_FATAL_ERROR(
1010
+ "fatal flex scanner internal error--end of buffer missed" );
1011
+
1012
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1013
+ { /* Don't try to fill the buffer, so this is an EOF. */
1014
+ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1015
+ {
1016
+ /* We matched a single character, the EOB, so
1017
+ * treat this as a final EOF.
1018
+ */
1019
+ return EOB_ACT_END_OF_FILE;
1020
+ }
1021
+
1022
+ else
1023
+ {
1024
+ /* We matched some text prior to the EOB, first
1025
+ * process it.
1026
+ */
1027
+ return EOB_ACT_LAST_MATCH;
1028
+ }
1029
+ }
1030
+
1031
+ /* Try to read more data. */
1032
+
1033
+ /* First move last chars to start of buffer. */
1034
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1035
+
1036
+ for ( i = 0; i < number_to_move; ++i )
1037
+ *(dest++) = *(source++);
1038
+
1039
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1040
+ /* don't do the read, it's not guaranteed to return an EOF,
1041
+ * just force an EOF
1042
+ */
1043
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1044
+
1045
+ else
1046
+ {
1047
+ int num_to_read =
1048
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1049
+
1050
+ while ( num_to_read <= 0 )
1051
+ { /* Not enough room in the buffer - grow it. */
1052
+
1053
+ /* just a shorter name for the current buffer */
1054
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1055
+
1056
+ int yy_c_buf_p_offset =
1057
+ (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1058
+
1059
+ if ( b->yy_is_our_buffer )
1060
+ {
1061
+ int new_size = b->yy_buf_size * 2;
1062
+
1063
+ if ( new_size <= 0 )
1064
+ b->yy_buf_size += b->yy_buf_size / 8;
1065
+ else
1066
+ b->yy_buf_size *= 2;
1067
+
1068
+ b->yy_ch_buf = (char *)
1069
+ /* Include room in for 2 EOB chars. */
1070
+ langscan_java_lex_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1071
+ }
1072
+ else
1073
+ /* Can't grow it, we don't own it. */
1074
+ b->yy_ch_buf = 0;
1075
+
1076
+ if ( ! b->yy_ch_buf )
1077
+ YY_FATAL_ERROR(
1078
+ "fatal error - scanner input buffer overflow" );
1079
+
1080
+ yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1081
+
1082
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1083
+ number_to_move - 1;
1084
+
1085
+ }
1086
+
1087
+ if ( num_to_read > YY_READ_BUF_SIZE )
1088
+ num_to_read = YY_READ_BUF_SIZE;
1089
+
1090
+ /* Read in more data. */
1091
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1092
+ yyg->yy_n_chars, (size_t) num_to_read );
1093
+
1094
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1095
+ }
1096
+
1097
+ if ( yyg->yy_n_chars == 0 )
1098
+ {
1099
+ if ( number_to_move == YY_MORE_ADJ )
1100
+ {
1101
+ ret_val = EOB_ACT_END_OF_FILE;
1102
+ langscan_java_lex_restart(yyin ,yyscanner);
1103
+ }
1104
+
1105
+ else
1106
+ {
1107
+ ret_val = EOB_ACT_LAST_MATCH;
1108
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1109
+ YY_BUFFER_EOF_PENDING;
1110
+ }
1111
+ }
1112
+
1113
+ else
1114
+ ret_val = EOB_ACT_CONTINUE_SCAN;
1115
+
1116
+ if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1117
+ /* Extend the array by 50%, plus the number we really need. */
1118
+ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1119
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) langscan_java_lex_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1120
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1121
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1122
+ }
1123
+
1124
+ yyg->yy_n_chars += number_to_move;
1125
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1126
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1127
+
1128
+ yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1129
+
1130
+ return ret_val;
1131
+ }
1132
+
1133
+ /* yy_get_previous_state - get the state just before the EOB char was reached */
1134
+
1135
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1136
+ {
1137
+ register yy_state_type yy_current_state;
1138
+ register char *yy_cp;
1139
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1140
+
1141
+ yy_current_state = yyg->yy_start;
1142
+
1143
+ for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1144
+ {
1145
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1146
+ if ( yy_accept[yy_current_state] )
1147
+ {
1148
+ yyg->yy_last_accepting_state = yy_current_state;
1149
+ yyg->yy_last_accepting_cpos = yy_cp;
1150
+ }
1151
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1152
+ {
1153
+ yy_current_state = (int) yy_def[yy_current_state];
1154
+ if ( yy_current_state >= 47 )
1155
+ yy_c = yy_meta[(unsigned int) yy_c];
1156
+ }
1157
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1158
+ }
1159
+
1160
+ return yy_current_state;
1161
+ }
1162
+
1163
+ /* yy_try_NUL_trans - try to make a transition on the NUL character
1164
+ *
1165
+ * synopsis
1166
+ * next_state = yy_try_NUL_trans( current_state );
1167
+ */
1168
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1169
+ {
1170
+ register int yy_is_jam;
1171
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1172
+ register char *yy_cp = yyg->yy_c_buf_p;
1173
+
1174
+ register YY_CHAR yy_c = 1;
1175
+ if ( yy_accept[yy_current_state] )
1176
+ {
1177
+ yyg->yy_last_accepting_state = yy_current_state;
1178
+ yyg->yy_last_accepting_cpos = yy_cp;
1179
+ }
1180
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1181
+ {
1182
+ yy_current_state = (int) yy_def[yy_current_state];
1183
+ if ( yy_current_state >= 47 )
1184
+ yy_c = yy_meta[(unsigned int) yy_c];
1185
+ }
1186
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1187
+ yy_is_jam = (yy_current_state == 46);
1188
+
1189
+ return yy_is_jam ? 0 : yy_current_state;
1190
+ }
1191
+
1192
+ static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
1193
+ {
1194
+ register char *yy_cp;
1195
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1196
+
1197
+ yy_cp = yyg->yy_c_buf_p;
1198
+
1199
+ /* undo effects of setting up yytext */
1200
+ *yy_cp = yyg->yy_hold_char;
1201
+
1202
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1203
+ { /* need to shift things up to make room */
1204
+ /* +2 for EOB chars. */
1205
+ register int number_to_move = yyg->yy_n_chars + 2;
1206
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1207
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1208
+ register char *source =
1209
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1210
+
1211
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1212
+ *--dest = *--source;
1213
+
1214
+ yy_cp += (int) (dest - source);
1215
+ yy_bp += (int) (dest - source);
1216
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1217
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1218
+
1219
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1220
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
1221
+ }
1222
+
1223
+ *--yy_cp = (char) c;
1224
+
1225
+ yyg->yytext_ptr = yy_bp;
1226
+ yyg->yy_hold_char = *yy_cp;
1227
+ yyg->yy_c_buf_p = yy_cp;
1228
+ }
1229
+
1230
+ #ifndef YY_NO_INPUT
1231
+ #ifdef __cplusplus
1232
+ static int yyinput (yyscan_t yyscanner)
1233
+ #else
1234
+ static int input (yyscan_t yyscanner)
1235
+ #endif
1236
+
1237
+ {
1238
+ int c;
1239
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1240
+
1241
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
1242
+
1243
+ if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1244
+ {
1245
+ /* yy_c_buf_p now points to the character we want to return.
1246
+ * If this occurs *before* the EOB characters, then it's a
1247
+ * valid NUL; if not, then we've hit the end of the buffer.
1248
+ */
1249
+ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1250
+ /* This was really a NUL. */
1251
+ *yyg->yy_c_buf_p = '\0';
1252
+
1253
+ else
1254
+ { /* need more input */
1255
+ int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1256
+ ++yyg->yy_c_buf_p;
1257
+
1258
+ switch ( yy_get_next_buffer( yyscanner ) )
1259
+ {
1260
+ case EOB_ACT_LAST_MATCH:
1261
+ /* This happens because yy_g_n_b()
1262
+ * sees that we've accumulated a
1263
+ * token and flags that we need to
1264
+ * try matching the token before
1265
+ * proceeding. But for input(),
1266
+ * there's no matching to consider.
1267
+ * So convert the EOB_ACT_LAST_MATCH
1268
+ * to EOB_ACT_END_OF_FILE.
1269
+ */
1270
+
1271
+ /* Reset buffer status. */
1272
+ langscan_java_lex_restart(yyin ,yyscanner);
1273
+
1274
+ /*FALLTHROUGH*/
1275
+
1276
+ case EOB_ACT_END_OF_FILE:
1277
+ {
1278
+ if ( langscan_java_lex_wrap(yyscanner ) )
1279
+ return EOF;
1280
+
1281
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
1282
+ YY_NEW_FILE;
1283
+ #ifdef __cplusplus
1284
+ return yyinput(yyscanner);
1285
+ #else
1286
+ return input(yyscanner);
1287
+ #endif
1288
+ }
1289
+
1290
+ case EOB_ACT_CONTINUE_SCAN:
1291
+ yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1292
+ break;
1293
+ }
1294
+ }
1295
+ }
1296
+
1297
+ c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1298
+ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1299
+ yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1300
+
1301
+ return c;
1302
+ }
1303
+ #endif /* ifndef YY_NO_INPUT */
1304
+
1305
+ /** Immediately switch to a different input stream.
1306
+ * @param input_file A readable stream.
1307
+ * @param yyscanner The scanner object.
1308
+ * @note This function does not reset the start condition to @c INITIAL .
1309
+ */
1310
+ void langscan_java_lex_restart (FILE * input_file , yyscan_t yyscanner)
1311
+ {
1312
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1313
+
1314
+ if ( ! YY_CURRENT_BUFFER ){
1315
+ langscan_java_lex_ensure_buffer_stack (yyscanner);
1316
+ YY_CURRENT_BUFFER_LVALUE =
1317
+ langscan_java_lex__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1318
+ }
1319
+
1320
+ langscan_java_lex__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1321
+ langscan_java_lex__load_buffer_state(yyscanner );
1322
+ }
1323
+
1324
+ /** Switch to a different input buffer.
1325
+ * @param new_buffer The new input buffer.
1326
+ * @param yyscanner The scanner object.
1327
+ */
1328
+ void langscan_java_lex__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1329
+ {
1330
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1331
+
1332
+ /* TODO. We should be able to replace this entire function body
1333
+ * with
1334
+ * langscan_java_lex_pop_buffer_state();
1335
+ * langscan_java_lex_push_buffer_state(new_buffer);
1336
+ */
1337
+ langscan_java_lex_ensure_buffer_stack (yyscanner);
1338
+ if ( YY_CURRENT_BUFFER == new_buffer )
1339
+ return;
1340
+
1341
+ if ( YY_CURRENT_BUFFER )
1342
+ {
1343
+ /* Flush out information for old buffer. */
1344
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
1345
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1346
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1347
+ }
1348
+
1349
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
1350
+ langscan_java_lex__load_buffer_state(yyscanner );
1351
+
1352
+ /* We don't actually know whether we did this switch during
1353
+ * EOF (langscan_java_lex_wrap()) processing, but the only time this flag
1354
+ * is looked at is after langscan_java_lex_wrap() is called, so it's safe
1355
+ * to go ahead and always set it.
1356
+ */
1357
+ yyg->yy_did_buffer_switch_on_eof = 1;
1358
+ }
1359
+
1360
+ static void langscan_java_lex__load_buffer_state (yyscan_t yyscanner)
1361
+ {
1362
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1363
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1364
+ yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1365
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1366
+ yyg->yy_hold_char = *yyg->yy_c_buf_p;
1367
+ }
1368
+
1369
+ /** Allocate and initialize an input buffer state.
1370
+ * @param file A readable stream.
1371
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1372
+ * @param yyscanner The scanner object.
1373
+ * @return the allocated buffer state.
1374
+ */
1375
+ YY_BUFFER_STATE langscan_java_lex__create_buffer (FILE * file, int size , yyscan_t yyscanner)
1376
+ {
1377
+ YY_BUFFER_STATE b;
1378
+
1379
+ b = (YY_BUFFER_STATE) langscan_java_lex_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1380
+ if ( ! b )
1381
+ YY_FATAL_ERROR( "out of dynamic memory in langscan_java_lex__create_buffer()" );
1382
+
1383
+ b->yy_buf_size = size;
1384
+
1385
+ /* yy_ch_buf has to be 2 characters longer than the size given because
1386
+ * we need to put in 2 end-of-buffer characters.
1387
+ */
1388
+ b->yy_ch_buf = (char *) langscan_java_lex_alloc(b->yy_buf_size + 2 ,yyscanner );
1389
+ if ( ! b->yy_ch_buf )
1390
+ YY_FATAL_ERROR( "out of dynamic memory in langscan_java_lex__create_buffer()" );
1391
+
1392
+ b->yy_is_our_buffer = 1;
1393
+
1394
+ langscan_java_lex__init_buffer(b,file ,yyscanner);
1395
+
1396
+ return b;
1397
+ }
1398
+
1399
+ /** Destroy the buffer.
1400
+ * @param b a buffer created with langscan_java_lex__create_buffer()
1401
+ * @param yyscanner The scanner object.
1402
+ */
1403
+ void langscan_java_lex__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1404
+ {
1405
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1406
+
1407
+ if ( ! b )
1408
+ return;
1409
+
1410
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1411
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1412
+
1413
+ if ( b->yy_is_our_buffer )
1414
+ langscan_java_lex_free((void *) b->yy_ch_buf ,yyscanner );
1415
+
1416
+ langscan_java_lex_free((void *) b ,yyscanner );
1417
+ }
1418
+
1419
+ #ifndef __cplusplus
1420
+ extern int isatty (int );
1421
+ #endif /* __cplusplus */
1422
+
1423
+ /* Initializes or reinitializes a buffer.
1424
+ * This function is sometimes called more than once on the same buffer,
1425
+ * such as during a langscan_java_lex_restart() or at EOF.
1426
+ */
1427
+ static void langscan_java_lex__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1428
+
1429
+ {
1430
+ int oerrno = errno;
1431
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1432
+
1433
+ langscan_java_lex__flush_buffer(b ,yyscanner);
1434
+
1435
+ b->yy_input_file = file;
1436
+ b->yy_fill_buffer = 1;
1437
+
1438
+ /* If b is the current buffer, then langscan_java_lex__init_buffer was _probably_
1439
+ * called from langscan_java_lex_restart() or through yy_get_next_buffer.
1440
+ * In that case, we don't want to reset the lineno or column.
1441
+ */
1442
+ if (b != YY_CURRENT_BUFFER){
1443
+ b->yy_bs_lineno = 1;
1444
+ b->yy_bs_column = 0;
1445
+ }
1446
+
1447
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1448
+
1449
+ errno = oerrno;
1450
+ }
1451
+
1452
+ /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1453
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1454
+ * @param yyscanner The scanner object.
1455
+ */
1456
+ void langscan_java_lex__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1457
+ {
1458
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1459
+ if ( ! b )
1460
+ return;
1461
+
1462
+ b->yy_n_chars = 0;
1463
+
1464
+ /* We always need two end-of-buffer characters. The first causes
1465
+ * a transition to the end-of-buffer state. The second causes
1466
+ * a jam in that state.
1467
+ */
1468
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1469
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1470
+
1471
+ b->yy_buf_pos = &b->yy_ch_buf[0];
1472
+
1473
+ b->yy_at_bol = 1;
1474
+ b->yy_buffer_status = YY_BUFFER_NEW;
1475
+
1476
+ if ( b == YY_CURRENT_BUFFER )
1477
+ langscan_java_lex__load_buffer_state(yyscanner );
1478
+ }
1479
+
1480
+ /** Pushes the new state onto the stack. The new state becomes
1481
+ * the current state. This function will allocate the stack
1482
+ * if necessary.
1483
+ * @param new_buffer The new state.
1484
+ * @param yyscanner The scanner object.
1485
+ */
1486
+ void langscan_java_lex_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1487
+ {
1488
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1489
+ if (new_buffer == NULL)
1490
+ return;
1491
+
1492
+ langscan_java_lex_ensure_buffer_stack(yyscanner);
1493
+
1494
+ /* This block is copied from langscan_java_lex__switch_to_buffer. */
1495
+ if ( YY_CURRENT_BUFFER )
1496
+ {
1497
+ /* Flush out information for old buffer. */
1498
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
1499
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1500
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1501
+ }
1502
+
1503
+ /* Only push if top exists. Otherwise, replace top. */
1504
+ if (YY_CURRENT_BUFFER)
1505
+ yyg->yy_buffer_stack_top++;
1506
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
1507
+
1508
+ /* copied from langscan_java_lex__switch_to_buffer. */
1509
+ langscan_java_lex__load_buffer_state(yyscanner );
1510
+ yyg->yy_did_buffer_switch_on_eof = 1;
1511
+ }
1512
+
1513
+ /** Removes and deletes the top of the stack, if present.
1514
+ * The next element becomes the new top.
1515
+ * @param yyscanner The scanner object.
1516
+ */
1517
+ void langscan_java_lex_pop_buffer_state (yyscan_t yyscanner)
1518
+ {
1519
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1520
+ if (!YY_CURRENT_BUFFER)
1521
+ return;
1522
+
1523
+ langscan_java_lex__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1524
+ YY_CURRENT_BUFFER_LVALUE = NULL;
1525
+ if (yyg->yy_buffer_stack_top > 0)
1526
+ --yyg->yy_buffer_stack_top;
1527
+
1528
+ if (YY_CURRENT_BUFFER) {
1529
+ langscan_java_lex__load_buffer_state(yyscanner );
1530
+ yyg->yy_did_buffer_switch_on_eof = 1;
1531
+ }
1532
+ }
1533
+
1534
+ /* Allocates the stack if it does not exist.
1535
+ * Guarantees space for at least one push.
1536
+ */
1537
+ static void langscan_java_lex_ensure_buffer_stack (yyscan_t yyscanner)
1538
+ {
1539
+ int num_to_alloc;
1540
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1541
+
1542
+ if (!yyg->yy_buffer_stack) {
1543
+
1544
+ /* First allocation is just for 2 elements, since we don't know if this
1545
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
1546
+ * immediate realloc on the next call.
1547
+ */
1548
+ num_to_alloc = 1;
1549
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)langscan_java_lex_alloc
1550
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
1551
+ , yyscanner);
1552
+ if ( ! yyg->yy_buffer_stack )
1553
+ YY_FATAL_ERROR( "out of dynamic memory in langscan_java_lex_ensure_buffer_stack()" );
1554
+
1555
+ memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1556
+
1557
+ yyg->yy_buffer_stack_max = num_to_alloc;
1558
+ yyg->yy_buffer_stack_top = 0;
1559
+ return;
1560
+ }
1561
+
1562
+ if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1563
+
1564
+ /* Increase the buffer to prepare for a possible push. */
1565
+ int grow_size = 8 /* arbitrary grow size */;
1566
+
1567
+ num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1568
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)langscan_java_lex_realloc
1569
+ (yyg->yy_buffer_stack,
1570
+ num_to_alloc * sizeof(struct yy_buffer_state*)
1571
+ , yyscanner);
1572
+ if ( ! yyg->yy_buffer_stack )
1573
+ YY_FATAL_ERROR( "out of dynamic memory in langscan_java_lex_ensure_buffer_stack()" );
1574
+
1575
+ /* zero only the new slots.*/
1576
+ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1577
+ yyg->yy_buffer_stack_max = num_to_alloc;
1578
+ }
1579
+ }
1580
+
1581
+ /** Setup the input buffer state to scan directly from a user-specified character buffer.
1582
+ * @param base the character buffer
1583
+ * @param size the size in bytes of the character buffer
1584
+ * @param yyscanner The scanner object.
1585
+ * @return the newly allocated buffer state object.
1586
+ */
1587
+ YY_BUFFER_STATE langscan_java_lex__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1588
+ {
1589
+ YY_BUFFER_STATE b;
1590
+
1591
+ if ( size < 2 ||
1592
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
1593
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
1594
+ /* They forgot to leave room for the EOB's. */
1595
+ return 0;
1596
+
1597
+ b = (YY_BUFFER_STATE) langscan_java_lex_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1598
+ if ( ! b )
1599
+ YY_FATAL_ERROR( "out of dynamic memory in langscan_java_lex__scan_buffer()" );
1600
+
1601
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1602
+ b->yy_buf_pos = b->yy_ch_buf = base;
1603
+ b->yy_is_our_buffer = 0;
1604
+ b->yy_input_file = 0;
1605
+ b->yy_n_chars = b->yy_buf_size;
1606
+ b->yy_is_interactive = 0;
1607
+ b->yy_at_bol = 1;
1608
+ b->yy_fill_buffer = 0;
1609
+ b->yy_buffer_status = YY_BUFFER_NEW;
1610
+
1611
+ langscan_java_lex__switch_to_buffer(b ,yyscanner );
1612
+
1613
+ return b;
1614
+ }
1615
+
1616
+ /** Setup the input buffer state to scan a string. The next call to langscan_java_lex_lex() will
1617
+ * scan from a @e copy of @a str.
1618
+ * @param yystr a NUL-terminated string to scan
1619
+ * @param yyscanner The scanner object.
1620
+ * @return the newly allocated buffer state object.
1621
+ * @note If you want to scan bytes that may contain NUL values, then use
1622
+ * langscan_java_lex__scan_bytes() instead.
1623
+ */
1624
+ YY_BUFFER_STATE langscan_java_lex__scan_string (yyconst char * yystr , yyscan_t yyscanner)
1625
+ {
1626
+
1627
+ return langscan_java_lex__scan_bytes(yystr,strlen(yystr) ,yyscanner);
1628
+ }
1629
+
1630
+ /** Setup the input buffer state to scan the given bytes. The next call to langscan_java_lex_lex() will
1631
+ * scan from a @e copy of @a bytes.
1632
+ * @param yybytes the byte buffer to scan
1633
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1634
+ * @param yyscanner The scanner object.
1635
+ * @return the newly allocated buffer state object.
1636
+ */
1637
+ YY_BUFFER_STATE langscan_java_lex__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1638
+ {
1639
+ YY_BUFFER_STATE b;
1640
+ char *buf;
1641
+ yy_size_t n;
1642
+ int i;
1643
+
1644
+ /* Get memory for full buffer, including space for trailing EOB's. */
1645
+ n = _yybytes_len + 2;
1646
+ buf = (char *) langscan_java_lex_alloc(n ,yyscanner );
1647
+ if ( ! buf )
1648
+ YY_FATAL_ERROR( "out of dynamic memory in langscan_java_lex__scan_bytes()" );
1649
+
1650
+ for ( i = 0; i < _yybytes_len; ++i )
1651
+ buf[i] = yybytes[i];
1652
+
1653
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1654
+
1655
+ b = langscan_java_lex__scan_buffer(buf,n ,yyscanner);
1656
+ if ( ! b )
1657
+ YY_FATAL_ERROR( "bad buffer in langscan_java_lex__scan_bytes()" );
1658
+
1659
+ /* It's okay to grow etc. this buffer, and we should throw it
1660
+ * away when we're done.
1661
+ */
1662
+ b->yy_is_our_buffer = 1;
1663
+
1664
+ return b;
1665
+ }
1666
+
1667
+ #ifndef YY_EXIT_FAILURE
1668
+ #define YY_EXIT_FAILURE 2
1669
+ #endif
1670
+
1671
+ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1672
+ {
1673
+ (void) fprintf( stderr, "%s\n", msg );
1674
+ exit( YY_EXIT_FAILURE );
1675
+ }
1676
+
1677
+ /* Redefine yyless() so it works in section 3 code. */
1678
+
1679
+ #undef yyless
1680
+ #define yyless(n) \
1681
+ do \
1682
+ { \
1683
+ /* Undo effects of setting up yytext. */ \
1684
+ int yyless_macro_arg = (n); \
1685
+ YY_LESS_LINENO(yyless_macro_arg);\
1686
+ yytext[yyleng] = yyg->yy_hold_char; \
1687
+ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1688
+ yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1689
+ *yyg->yy_c_buf_p = '\0'; \
1690
+ yyleng = yyless_macro_arg; \
1691
+ } \
1692
+ while ( 0 )
1693
+
1694
+ /* Accessor methods (get/set functions) to struct members. */
1695
+
1696
+ /** Get the user-defined data for this scanner.
1697
+ * @param yyscanner The scanner object.
1698
+ */
1699
+ YY_EXTRA_TYPE langscan_java_lex_get_extra (yyscan_t yyscanner)
1700
+ {
1701
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1702
+ return yyextra;
1703
+ }
1704
+
1705
+ /** Get the current line number.
1706
+ * @param yyscanner The scanner object.
1707
+ */
1708
+ int langscan_java_lex_get_lineno (yyscan_t yyscanner)
1709
+ {
1710
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1711
+
1712
+ if (! YY_CURRENT_BUFFER)
1713
+ return 0;
1714
+
1715
+ return yylineno;
1716
+ }
1717
+
1718
+ /** Get the current column number.
1719
+ * @param yyscanner The scanner object.
1720
+ */
1721
+ int langscan_java_lex_get_column (yyscan_t yyscanner)
1722
+ {
1723
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1724
+
1725
+ if (! YY_CURRENT_BUFFER)
1726
+ return 0;
1727
+
1728
+ return yycolumn;
1729
+ }
1730
+
1731
+ /** Get the input stream.
1732
+ * @param yyscanner The scanner object.
1733
+ */
1734
+ FILE *langscan_java_lex_get_in (yyscan_t yyscanner)
1735
+ {
1736
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1737
+ return yyin;
1738
+ }
1739
+
1740
+ /** Get the output stream.
1741
+ * @param yyscanner The scanner object.
1742
+ */
1743
+ FILE *langscan_java_lex_get_out (yyscan_t yyscanner)
1744
+ {
1745
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1746
+ return yyout;
1747
+ }
1748
+
1749
+ /** Get the length of the current token.
1750
+ * @param yyscanner The scanner object.
1751
+ */
1752
+ int langscan_java_lex_get_leng (yyscan_t yyscanner)
1753
+ {
1754
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1755
+ return yyleng;
1756
+ }
1757
+
1758
+ /** Get the current token.
1759
+ * @param yyscanner The scanner object.
1760
+ */
1761
+
1762
+ char *langscan_java_lex_get_text (yyscan_t yyscanner)
1763
+ {
1764
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1765
+ return yytext;
1766
+ }
1767
+
1768
+ /** Set the user-defined data. This data is never touched by the scanner.
1769
+ * @param user_defined The data to be associated with this scanner.
1770
+ * @param yyscanner The scanner object.
1771
+ */
1772
+ void langscan_java_lex_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1773
+ {
1774
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1775
+ yyextra = user_defined ;
1776
+ }
1777
+
1778
+ /** Set the current line number.
1779
+ * @param line_number
1780
+ * @param yyscanner The scanner object.
1781
+ */
1782
+ void langscan_java_lex_set_lineno (int line_number , yyscan_t yyscanner)
1783
+ {
1784
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1785
+
1786
+ /* lineno is only valid if an input buffer exists. */
1787
+ if (! YY_CURRENT_BUFFER )
1788
+ yy_fatal_error( "langscan_java_lex_set_lineno called with no buffer" , yyscanner);
1789
+
1790
+ yylineno = line_number;
1791
+ }
1792
+
1793
+ /** Set the current column.
1794
+ * @param line_number
1795
+ * @param yyscanner The scanner object.
1796
+ */
1797
+ void langscan_java_lex_set_column (int column_no , yyscan_t yyscanner)
1798
+ {
1799
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1800
+
1801
+ /* column is only valid if an input buffer exists. */
1802
+ if (! YY_CURRENT_BUFFER )
1803
+ yy_fatal_error( "langscan_java_lex_set_column called with no buffer" , yyscanner);
1804
+
1805
+ yycolumn = column_no;
1806
+ }
1807
+
1808
+ /** Set the input stream. This does not discard the current
1809
+ * input buffer.
1810
+ * @param in_str A readable stream.
1811
+ * @param yyscanner The scanner object.
1812
+ * @see langscan_java_lex__switch_to_buffer
1813
+ */
1814
+ void langscan_java_lex_set_in (FILE * in_str , yyscan_t yyscanner)
1815
+ {
1816
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1817
+ yyin = in_str ;
1818
+ }
1819
+
1820
+ void langscan_java_lex_set_out (FILE * out_str , yyscan_t yyscanner)
1821
+ {
1822
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1823
+ yyout = out_str ;
1824
+ }
1825
+
1826
+ int langscan_java_lex_get_debug (yyscan_t yyscanner)
1827
+ {
1828
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1829
+ return yy_flex_debug;
1830
+ }
1831
+
1832
+ void langscan_java_lex_set_debug (int bdebug , yyscan_t yyscanner)
1833
+ {
1834
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1835
+ yy_flex_debug = bdebug ;
1836
+ }
1837
+
1838
+ /* Accessor methods for yylval and yylloc */
1839
+
1840
+ /* User-visible API */
1841
+
1842
+ /* langscan_java_lex_lex_init is special because it creates the scanner itself, so it is
1843
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
1844
+ * That's why we explicitly handle the declaration, instead of using our macros.
1845
+ */
1846
+
1847
+ int langscan_java_lex_lex_init(yyscan_t* ptr_yy_globals)
1848
+
1849
+ {
1850
+ if (ptr_yy_globals == NULL){
1851
+ errno = EINVAL;
1852
+ return 1;
1853
+ }
1854
+
1855
+ *ptr_yy_globals = (yyscan_t) langscan_java_lex_alloc ( sizeof( struct yyguts_t ), NULL );
1856
+
1857
+ if (*ptr_yy_globals == NULL){
1858
+ errno = ENOMEM;
1859
+ return 1;
1860
+ }
1861
+
1862
+ /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
1863
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
1864
+
1865
+ return yy_init_globals ( *ptr_yy_globals );
1866
+ }
1867
+
1868
+ /* langscan_java_lex_lex_init_extra has the same functionality as langscan_java_lex_lex_init, but follows the
1869
+ * convention of taking the scanner as the last argument. Note however, that
1870
+ * this is a *pointer* to a scanner, as it will be allocated by this call (and
1871
+ * is the reason, too, why this function also must handle its own declaration).
1872
+ * The user defined value in the first argument will be available to langscan_java_lex_alloc in
1873
+ * the yyextra field.
1874
+ */
1875
+
1876
+ int langscan_java_lex_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
1877
+
1878
+ {
1879
+ struct yyguts_t dummy_yyguts;
1880
+
1881
+ langscan_java_lex_set_extra (yy_user_defined, &dummy_yyguts);
1882
+
1883
+ if (ptr_yy_globals == NULL){
1884
+ errno = EINVAL;
1885
+ return 1;
1886
+ }
1887
+
1888
+ *ptr_yy_globals = (yyscan_t) langscan_java_lex_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
1889
+
1890
+ if (*ptr_yy_globals == NULL){
1891
+ errno = ENOMEM;
1892
+ return 1;
1893
+ }
1894
+
1895
+ /* By setting to 0xAA, we expose bugs in
1896
+ yy_init_globals. Leave at 0x00 for releases. */
1897
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
1898
+
1899
+ langscan_java_lex_set_extra (yy_user_defined, *ptr_yy_globals);
1900
+
1901
+ return yy_init_globals ( *ptr_yy_globals );
1902
+ }
1903
+
1904
+ static int yy_init_globals (yyscan_t yyscanner)
1905
+ {
1906
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1907
+ /* Initialization is the same as for the non-reentrant scanner.
1908
+ * This function is called from langscan_java_lex_lex_destroy(), so don't allocate here.
1909
+ */
1910
+
1911
+ yyg->yy_buffer_stack = 0;
1912
+ yyg->yy_buffer_stack_top = 0;
1913
+ yyg->yy_buffer_stack_max = 0;
1914
+ yyg->yy_c_buf_p = (char *) 0;
1915
+ yyg->yy_init = 0;
1916
+ yyg->yy_start = 0;
1917
+
1918
+ yyg->yy_start_stack_ptr = 0;
1919
+ yyg->yy_start_stack_depth = 0;
1920
+ yyg->yy_start_stack = NULL;
1921
+
1922
+ /* Defined in main.c */
1923
+ #ifdef YY_STDINIT
1924
+ yyin = stdin;
1925
+ yyout = stdout;
1926
+ #else
1927
+ yyin = (FILE *) 0;
1928
+ yyout = (FILE *) 0;
1929
+ #endif
1930
+
1931
+ /* For future reference: Set errno on error, since we are called by
1932
+ * langscan_java_lex_lex_init()
1933
+ */
1934
+ return 0;
1935
+ }
1936
+
1937
+ /* langscan_java_lex_lex_destroy is for both reentrant and non-reentrant scanners. */
1938
+ int langscan_java_lex_lex_destroy (yyscan_t yyscanner)
1939
+ {
1940
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1941
+
1942
+ /* Pop the buffer stack, destroying each element. */
1943
+ while(YY_CURRENT_BUFFER){
1944
+ langscan_java_lex__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
1945
+ YY_CURRENT_BUFFER_LVALUE = NULL;
1946
+ langscan_java_lex_pop_buffer_state(yyscanner);
1947
+ }
1948
+
1949
+ /* Destroy the stack itself. */
1950
+ langscan_java_lex_free(yyg->yy_buffer_stack ,yyscanner);
1951
+ yyg->yy_buffer_stack = NULL;
1952
+
1953
+ /* Destroy the start condition stack. */
1954
+ langscan_java_lex_free(yyg->yy_start_stack ,yyscanner );
1955
+ yyg->yy_start_stack = NULL;
1956
+
1957
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
1958
+ * langscan_java_lex_lex() is called, initialization will occur. */
1959
+ yy_init_globals( yyscanner);
1960
+
1961
+ /* Destroy the main struct (reentrant only). */
1962
+ langscan_java_lex_free ( yyscanner , yyscanner );
1963
+ yyscanner = NULL;
1964
+ return 0;
1965
+ }
1966
+
1967
+ /*
1968
+ * Internal utility routines.
1969
+ */
1970
+
1971
+ #ifndef yytext_ptr
1972
+ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
1973
+ {
1974
+ register int i;
1975
+ for ( i = 0; i < n; ++i )
1976
+ s1[i] = s2[i];
1977
+ }
1978
+ #endif
1979
+
1980
+ #ifdef YY_NEED_STRLEN
1981
+ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
1982
+ {
1983
+ register int n;
1984
+ for ( n = 0; s[n]; ++n )
1985
+ ;
1986
+
1987
+ return n;
1988
+ }
1989
+ #endif
1990
+
1991
+ void *langscan_java_lex_alloc (yy_size_t size , yyscan_t yyscanner)
1992
+ {
1993
+ return (void *) malloc( size );
1994
+ }
1995
+
1996
+ void *langscan_java_lex_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
1997
+ {
1998
+ /* The cast to (char *) in the following accommodates both
1999
+ * implementations that use char* generic pointers, and those
2000
+ * that use void* generic pointers. It works with the latter
2001
+ * because both ANSI C and C++ allow castless assignment from
2002
+ * any pointer type to void*, and deal with argument conversions
2003
+ * as though doing an assignment.
2004
+ */
2005
+ return (void *) realloc( (char *) ptr, size );
2006
+ }
2007
+
2008
+ void langscan_java_lex_free (void * ptr , yyscan_t yyscanner)
2009
+ {
2010
+ free( (char *) ptr ); /* see langscan_java_lex_realloc() for (char *) cast */
2011
+ }
2012
+
2013
+ #define YYTABLES_NAME "yytables"
2014
+
2015
+ static void update_pos(
2016
+ langscan_java_lex_extra_t *extra,
2017
+ char *text,
2018
+ int leng)
2019
+ {
2020
+ int i, j;
2021
+ extra->beg_byteno = extra->end_byteno;
2022
+ extra->beg_lineno = extra->end_lineno;
2023
+ extra->beg_columnno = extra->end_columnno;
2024
+ j = 0;
2025
+ for (i = 0; i < leng; i++) {
2026
+ if (text[i] == '\n') {
2027
+ extra->end_lineno++;
2028
+ j = i + 1;
2029
+ extra->end_columnno = 0;
2030
+ }
2031
+ }
2032
+ extra->end_columnno += leng - j;
2033
+ extra->end_byteno += leng;
2034
+ }
2035
+
2036
+ langscan_java_tokenizer_t *langscan_java_make_tokenizer(
2037
+ size_t (*user_read)(void **user_data_p, char *buf, size_t maxlen),
2038
+ void *user_data)
2039
+ {
2040
+ langscan_java_tokenizer_t *tokenizer;
2041
+ langscan_java_lex_extra_t *extra;
2042
+ tokenizer = (langscan_java_tokenizer_t *)malloc(sizeof(langscan_java_tokenizer_t));
2043
+ if (tokenizer == NULL)
2044
+ return NULL;
2045
+ extra = (langscan_java_lex_extra_t *)malloc(sizeof(langscan_java_lex_extra_t));
2046
+ if (extra == NULL)
2047
+ return NULL;
2048
+ extra->user_read = user_read;
2049
+ extra->user_data = user_data;
2050
+ extra->beg_lineno = 1;
2051
+ extra->beg_columnno = 0;
2052
+ extra->beg_byteno = 0;
2053
+ extra->end_lineno = 1;
2054
+ extra->end_columnno = 0;
2055
+ extra->end_byteno = 0;
2056
+ extra->eof = 0;
2057
+ tokenizer->extra = extra;
2058
+ langscan_java_lex_lex_init(&tokenizer->scanner);
2059
+ langscan_java_lex_set_extra(extra, tokenizer->scanner);
2060
+ return tokenizer;
2061
+ }
2062
+
2063
+ langscan_java_token_t langscan_java_get_token(langscan_java_tokenizer_t *tokenizer)
2064
+ {
2065
+ return langscan_java_lex_lex(tokenizer->scanner);
2066
+ }
2067
+
2068
+ void langscan_java_free_tokenizer(langscan_java_tokenizer_t *tokenizer)
2069
+ {
2070
+ langscan_java_lex_extra_t *extra = langscan_java_lex_get_extra(tokenizer->scanner);
2071
+ free((void *)extra);
2072
+ langscan_java_lex_lex_destroy(tokenizer->scanner);
2073
+ free((void *)tokenizer);
2074
+ }
2075
+
2076
+ user_read_t langscan_java_tokenizer_get_user_read(langscan_java_tokenizer_t *tokenizer)
2077
+ {
2078
+ return tokenizer->extra->user_read;
2079
+ }
2080
+
2081
+ void *langscan_java_tokenizer_get_user_data(langscan_java_tokenizer_t *tokenizer)
2082
+ {
2083
+ return tokenizer->extra->user_data;
2084
+ }
2085
+
2086
+ const char *langscan_java_token_name(langscan_java_token_t token)
2087
+ {
2088
+ static char *token_names[] = {
2089
+ "*eof*",
2090
+ #define LANGSCAN_JAVA_TOKEN(name) #name,
2091
+ LANGSCAN_JAVA_TOKEN_LIST
2092
+ #undef LANGSCAN_JAVA_TOKEN
2093
+ };
2094
+
2095
+ return token_names[token];
2096
+ }
2097
+