fancy 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/README.md +4 -1
  2. data/Rakefile +8 -0
  3. data/bin/fyi +25 -20
  4. data/bin/ifancy +39 -5
  5. data/{extconf.rb → boot/extconf.rb} +1 -1
  6. data/boot/fancy_ext/block_env.rb +0 -14
  7. data/boot/fancy_ext/kernel.rb +6 -2
  8. data/boot/rbx-compiler/parser/fancy_parser.bundle +0 -0
  9. data/examples/actor.fy +37 -0
  10. data/examples/armstrong_numbers.fy +1 -1
  11. data/examples/curl_async.fy +37 -0
  12. data/examples/echo.fy +1 -1
  13. data/examples/factorial.fy +1 -1
  14. data/examples/future_composition.fy +20 -0
  15. data/examples/game_of_life.fy +2 -2
  16. data/examples/person.fy +4 -8
  17. data/examples/rbx/blocks.fy +1 -1
  18. data/examples/return.fy +1 -1
  19. data/examples/struct.fy +9 -0
  20. data/lib/argv.fy +2 -2
  21. data/lib/array.fy +157 -0
  22. data/lib/block.fy +18 -1
  23. data/lib/boot.fy +5 -1
  24. data/lib/compiler/ast/class_def.fy +1 -1
  25. data/lib/compiler/ast/identifier.fy +2 -2
  26. data/lib/compiler/ast/message_send.fy +2 -2
  27. data/lib/compiler/ast/method_def.fy +2 -2
  28. data/lib/compiler/ast/try_catch.fy +5 -1
  29. data/lib/documentation.fy +1 -1
  30. data/lib/enumerable.fy +3 -7
  31. data/lib/enumerator.fy +77 -0
  32. data/lib/false_class.fy +52 -0
  33. data/lib/fancy_spec.fy +40 -12
  34. data/lib/fdoc.fy +2 -2
  35. data/lib/file.fy +8 -1
  36. data/lib/future.fy +23 -2
  37. data/lib/iteration.fy +60 -0
  38. data/lib/main.fy +4 -4
  39. data/lib/nil_class.fy +14 -22
  40. data/lib/number.fy +51 -0
  41. data/lib/object.fy +126 -43
  42. data/lib/package/installer.fy +1 -1
  43. data/lib/parser/ext/lexer.lex +6 -1
  44. data/lib/parser/ext/parser.y +18 -0
  45. data/lib/parser/methods.fy +20 -2
  46. data/lib/proxy.fy +20 -3
  47. data/lib/rbx.fy +0 -1
  48. data/lib/rbx/array.fy +4 -138
  49. data/lib/rbx/block.fy +25 -1
  50. data/lib/rbx/class.fy +21 -0
  51. data/lib/rbx/exception.fy +1 -0
  52. data/lib/rbx/fiber.fy +1 -0
  53. data/lib/rbx/file.fy +8 -0
  54. data/lib/rbx/integer.fy +0 -8
  55. data/lib/rbx/method.fy +34 -7
  56. data/lib/rbx/no_method_error.fy +8 -1
  57. data/lib/rbx/object.fy +3 -32
  58. data/lib/rbx/range.fy +13 -1
  59. data/lib/rbx/regexp.fy +3 -0
  60. data/lib/rbx/string.fy +6 -1
  61. data/lib/rbx/system.fy +20 -2
  62. data/lib/set.fy +2 -2
  63. data/lib/string.fy +1 -1
  64. data/lib/struct.fy +15 -12
  65. data/lib/symbol.fy +2 -2
  66. data/lib/true_class.fy +16 -20
  67. data/lib/version.fy +1 -1
  68. data/tests/argv.fy +1 -0
  69. data/tests/array.fy +33 -2
  70. data/tests/block.fy +44 -0
  71. data/tests/class.fy +102 -88
  72. data/tests/control_flow.fy +131 -8
  73. data/tests/enumerator.fy +85 -0
  74. data/tests/exception.fy +13 -13
  75. data/tests/file.fy +4 -13
  76. data/tests/future.fy +26 -0
  77. data/tests/method.fy +83 -72
  78. data/tests/nil_class.fy +20 -13
  79. data/tests/number.fy +16 -9
  80. data/tests/object.fy +39 -20
  81. data/tests/string.fy +7 -0
  82. data/tests/true_class.fy +4 -4
  83. data/tools/fancy-mode.el +1 -1
  84. metadata +15 -20
  85. data/boot/compiler/parser/ext/fancy_parser.bundle +0 -0
  86. data/boot/rbx-compiler/parser/Makefile +0 -162
  87. data/boot/rbx-compiler/parser/lexer.c +0 -2316
  88. data/boot/rbx-compiler/parser/lexer.h +0 -315
  89. data/boot/rbx-compiler/parser/parser.c +0 -3105
  90. data/boot/rbx-compiler/parser/parser.h +0 -114
  91. data/lib/lazy_array.fy +0 -23
  92. data/lib/parser/ext/Makefile +0 -162
  93. data/lib/parser/ext/fancy_parser.bundle +0 -0
  94. data/lib/parser/ext/lexer.c +0 -2360
  95. data/lib/parser/ext/lexer.h +0 -315
  96. data/lib/parser/ext/parser.c +0 -3382
  97. data/lib/parser/ext/parser.h +0 -118
  98. data/lib/rbx/false_class.fy +0 -58
@@ -1,114 +0,0 @@
1
- /* A Bison parser, made by GNU Bison 2.4.3. */
2
-
3
- /* Skeleton interface for Bison's Yacc-like parsers in C
4
-
5
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6
- 2009, 2010 Free Software Foundation, Inc.
7
-
8
- This program is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 3 of the License, or
11
- (at your option) any later version.
12
-
13
- This program is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
-
21
- /* As a special exception, you may create a larger work that contains
22
- part or all of the Bison parser skeleton and distribute that work
23
- under terms of your choice, so long as that work isn't itself a
24
- parser generator using the skeleton or a modified version thereof
25
- as a parser skeleton. Alternatively, if you modify or redistribute
26
- the parser skeleton itself, you may (at your option) remove this
27
- special exception, which will cause the skeleton and the resulting
28
- Bison output files to be licensed under the GNU General Public
29
- License without this special exception.
30
-
31
- This special exception was added by the Free Software Foundation in
32
- version 2.2 of Bison. */
33
-
34
-
35
- /* Tokens. */
36
- #ifndef YYTOKENTYPE
37
- # define YYTOKENTYPE
38
- /* Put the tokens into the symbol table, so that GDB and other debuggers
39
- know about them. */
40
- enum yytokentype {
41
- LPAREN = 258,
42
- RPAREN = 259,
43
- LCURLY = 260,
44
- RCURLY = 261,
45
- LBRACKET = 262,
46
- RBRACKET = 263,
47
- LHASH = 264,
48
- RHASH = 265,
49
- STAB = 266,
50
- ARROW = 267,
51
- THIN_ARROW = 268,
52
- COMMA = 269,
53
- SEMI = 270,
54
- NL = 271,
55
- COLON = 272,
56
- RETURN_LOCAL = 273,
57
- RETURN = 274,
58
- REQUIRE = 275,
59
- TRY = 276,
60
- CATCH = 277,
61
- FINALLY = 278,
62
- RETRY = 279,
63
- SUPER = 280,
64
- PRIVATE = 281,
65
- PROTECTED = 282,
66
- CLASS = 283,
67
- DEF = 284,
68
- DOT = 285,
69
- DOLLAR = 286,
70
- EQUALS = 287,
71
- MATCH = 288,
72
- CASE = 289,
73
- IDENTIFIER = 290,
74
- RUBY_SEND_OPEN = 291,
75
- RUBY_OPER_OPEN = 292,
76
- CONSTANT = 293,
77
- INTEGER_LITERAL = 294,
78
- HEX_LITERAL = 295,
79
- OCT_LITERAL = 296,
80
- BIN_LITERAL = 297,
81
- DOUBLE_LITERAL = 298,
82
- STRING_LITERAL = 299,
83
- MULTI_STRING_LITERAL = 300,
84
- SYMBOL_LITERAL = 301,
85
- REGEX_LITERAL = 302,
86
- OPERATOR = 303
87
- };
88
- #endif
89
-
90
-
91
-
92
- #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
93
- typedef union YYSTYPE
94
- {
95
-
96
- /* Line 1685 of yacc.c */
97
- #line 18 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/parser.y"
98
-
99
- VALUE object;
100
- ID symbol;
101
-
102
-
103
-
104
- /* Line 1685 of yacc.c */
105
- #line 106 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/parser.h"
106
- } YYSTYPE;
107
- # define YYSTYPE_IS_TRIVIAL 1
108
- # define yystype YYSTYPE /* obsolescent; will be withdrawn */
109
- # define YYSTYPE_IS_DECLARED 1
110
- #endif
111
-
112
- extern YYSTYPE yylval;
113
-
114
-
data/lib/lazy_array.fy DELETED
@@ -1,23 +0,0 @@
1
- require: "rbx/fiber"
2
- class LazyArray {
3
- def initialize: generator {
4
- @generator = Fiber new: generator
5
- }
6
-
7
- def each: block {
8
- while: (@generator resume) do: |val| {
9
- block call: [val]
10
- }
11
- }
12
-
13
- def map: block {
14
- LazyArray new: block
15
- }
16
- }
17
-
18
- l1 = LazyArray new: |i| { i doubled }
19
- l2 = l1 map: |x| { x squared }
20
-
21
- l2 each: |x| {
22
- x inspect println
23
- }
@@ -1,162 +0,0 @@
1
-
2
- SHELL = /bin/sh
3
-
4
- #### Start of system configuration section. ####
5
-
6
- srcdir = /Users/backtype/projects/fancy/lib/parser/ext
7
- topdir = /Users/backtype/projects/rubinius/vm/capi/include
8
- hdrdir = $(topdir)
9
- VPATH = $(srcdir):$(topdir):$(hdrdir)
10
- prefix = $(DESTDIR)/Users/backtype/projects/rubinius
11
- exec_prefix = $(prefix)
12
- install_prefix = $(DESTDIR)
13
- includedir = $(prefix)/include
14
- bindir = $(DESTDIR)/Users/backtype/projects/rubinius/bin
15
- sysconfdir = $(prefix)/etc
16
- localedir = $(datarootdir)/locale
17
- rubylibdir = $(DESTDIR)/Users/backtype/projects/rubinius/lib/site
18
- sitedir = $(DESTDIR)/Users/backtype/projects/rubinius/lib/site
19
- oldincludedir = $(DESTDIR)/usr/include
20
- libexecdir = $(exec_prefix)/libexec
21
- rubyhdrdir = $(DESTDIR)/Users/backtype/projects/rubinius/vm/capi/include
22
- libdir = $(exec_prefix)/lib
23
- dvidir = $(docdir)
24
- docdir = $(datarootdir)/doc/$(PACKAGE)
25
- psdir = $(docdir)
26
- infodir = $(datarootdir)/info
27
- datadir = $(datarootdir)
28
- archdir = $(DESTDIR)/Users/backtype/projects/rubinius/lib/site/x86_64-darwin10.5.0
29
- sharedstatedir = $(prefix)/com
30
- localstatedir = $(prefix)/var
31
- pdfdir = $(docdir)
32
- htmldir = $(docdir)
33
- datarootdir = $(prefix)/share
34
- sbindir = $(exec_prefix)/sbin
35
- sitelibdir = $(DESTDIR)/Users/backtype/projects/rubinius/lib/site
36
- mandir = $(datarootdir)/man
37
- sitearchdir = $(DESTDIR)/Users/backtype/projects/rubinius/lib/site/x86_64-darwin10.5.0
38
-
39
- CC = gcc
40
- LIBRUBY = $(LIBRUBY_SO)
41
- LIBRUBY_A =
42
- LIBRUBYARG_SHARED =
43
- LIBRUBYARG_STATIC =
44
-
45
- RUBY_EXTCONF_H =
46
- cflags =
47
- optflags =
48
- debugflags =
49
- warnflags =
50
- CFLAGS = -fPIC -ggdb3 -O2 -fPIC
51
- INCFLAGS = -I. -I. -I/Users/backtype/projects/rubinius/vm/capi/include -I/Users/backtype/projects/fancy/lib/parser/ext
52
- DEFS =
53
- CPPFLAGS =
54
- CXXFLAGS = $(CFLAGS)
55
- ldflags =
56
- dldflags =
57
- archflag =
58
- DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
59
- LDSHARED = gcc -dynamic -bundle -undefined suppress -flat_namespace
60
- AR = ar
61
- EXEEXT =
62
-
63
- RUBY_INSTALL_NAME = rbx
64
- RUBY_SO_NAME = rubinius-1.2.3dev
65
- arch = x86_64-darwin10.5.0
66
- sitearch = x86_64-darwin10.5.0
67
- ruby_version = 1.8
68
- ruby = /Users/backtype/projects/rubinius/bin/rbx
69
- RUBY = $(ruby)
70
- RM = rm -f
71
- MAKEDIRS = mkdir -p
72
- INSTALL = install -c
73
- INSTALL_PROG = $(INSTALL) -m 0755
74
- INSTALL_DATA = $(INSTALL) -m 644
75
- COPY = cp
76
-
77
- #### End of system configuration section. ####
78
-
79
- preload =
80
-
81
- libpath = . $(libdir)
82
- LIBPATH = -L. -L$(libdir)
83
- DEFFILE =
84
-
85
- CLEANFILES = mkmf.log
86
- DISTCLEANFILES =
87
-
88
- extout =
89
- extout_prefix =
90
- target_prefix =
91
- LOCAL_LIBS =
92
- LIBS = $(LIBRUBYARG_STATIC) -lfl
93
- SRCS = ext.c lexer.c parser.c
94
- OBJS = ext.o lexer.o parser.o
95
- TARGET = fancy_parser
96
- DLLIB = $(TARGET).bundle
97
- EXTSTATIC =
98
- STATIC_LIB =
99
-
100
- BINDIR = $(bindir)
101
- RUBYCOMMONDIR = $(sitedir)$(target_prefix)
102
- RUBYLIBDIR = $(sitelibdir)$(target_prefix)
103
- RUBYARCHDIR = $(sitearchdir)$(target_prefix)
104
-
105
- TARGET_SO = $(DLLIB)
106
- CLEANLIBS = $(TARGET).bundle
107
- CLEANOBJS = *.o *.bak
108
-
109
- all: $(DLLIB)
110
- static: $(STATIC_LIB)
111
- .PHONY: all install static install-so install-rb
112
- .PHONY: clean clean-so clean-rb
113
-
114
- clean:
115
- @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
116
-
117
- distclean: clean
118
- @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
119
- @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
120
-
121
- realclean: distclean
122
- install: install-so install-rb
123
-
124
- install-so: $(RUBYARCHDIR)
125
- install-so: $(RUBYARCHDIR)/$(DLLIB)
126
- $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
127
- $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
128
- install-rb: pre-install-rb install-rb-default
129
- install-rb-default: pre-install-rb-default
130
- pre-install-rb: Makefile
131
- pre-install-rb-default: Makefile
132
- $(RUBYARCHDIR):
133
- $(MAKEDIRS) $@
134
-
135
- site-install: site-install-so site-install-rb
136
- site-install-so: install-so
137
- site-install-rb: install-rb
138
-
139
- .SUFFIXES: .c .m .cc .cxx .cpp .C .o
140
-
141
- .cc.o:
142
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
143
-
144
- .cxx.o:
145
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
146
-
147
- .cpp.o:
148
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
149
-
150
- .C.o:
151
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
152
-
153
- .c.o:
154
- $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
155
-
156
- $(DLLIB): $(OBJS) Makefile
157
- @-$(RM) $@
158
- $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
159
-
160
-
161
-
162
- $(OBJS): ruby.h defines.h
Binary file
@@ -1,2360 +0,0 @@
1
- #line 2 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.c"
2
-
3
- #line 4 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.c"
4
-
5
- #define YY_INT_ALIGNED short int
6
-
7
- /* A lexical scanner generated by flex */
8
-
9
- #define FLEX_SCANNER
10
- #define YY_FLEX_MAJOR_VERSION 2
11
- #define YY_FLEX_MINOR_VERSION 5
12
- #define YY_FLEX_SUBMINOR_VERSION 35
13
- #if YY_FLEX_SUBMINOR_VERSION > 0
14
- #define FLEX_BETA
15
- #endif
16
-
17
- /* First, we deal with platform-specific or compiler-specific issues. */
18
-
19
- /* begin standard C headers. */
20
- #include <stdio.h>
21
- #include <string.h>
22
- #include <errno.h>
23
- #include <stdlib.h>
24
-
25
- /* end standard C headers. */
26
-
27
- /* flex integer type definitions */
28
-
29
- #ifndef FLEXINT_H
30
- #define FLEXINT_H
31
-
32
- /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
-
34
- #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
-
36
- /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37
- * if you want the limit (max/min) macros for int types.
38
- */
39
- #ifndef __STDC_LIMIT_MACROS
40
- #define __STDC_LIMIT_MACROS 1
41
- #endif
42
-
43
- #include <inttypes.h>
44
- typedef int8_t flex_int8_t;
45
- typedef uint8_t flex_uint8_t;
46
- typedef int16_t flex_int16_t;
47
- typedef uint16_t flex_uint16_t;
48
- typedef int32_t flex_int32_t;
49
- typedef uint32_t flex_uint32_t;
50
- #else
51
- typedef signed char flex_int8_t;
52
- typedef short int flex_int16_t;
53
- typedef int flex_int32_t;
54
- typedef unsigned char flex_uint8_t;
55
- typedef unsigned short int flex_uint16_t;
56
- typedef unsigned int flex_uint32_t;
57
- #endif /* ! C99 */
58
-
59
- /* Limits of integral types. */
60
- #ifndef INT8_MIN
61
- #define INT8_MIN (-128)
62
- #endif
63
- #ifndef INT16_MIN
64
- #define INT16_MIN (-32767-1)
65
- #endif
66
- #ifndef INT32_MIN
67
- #define INT32_MIN (-2147483647-1)
68
- #endif
69
- #ifndef INT8_MAX
70
- #define INT8_MAX (127)
71
- #endif
72
- #ifndef INT16_MAX
73
- #define INT16_MAX (32767)
74
- #endif
75
- #ifndef INT32_MAX
76
- #define INT32_MAX (2147483647)
77
- #endif
78
- #ifndef UINT8_MAX
79
- #define UINT8_MAX (255U)
80
- #endif
81
- #ifndef UINT16_MAX
82
- #define UINT16_MAX (65535U)
83
- #endif
84
- #ifndef UINT32_MAX
85
- #define UINT32_MAX (4294967295U)
86
- #endif
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
- /* Enter a start condition. This macro really ought to take a parameter,
122
- * but we do it the disgusting crufty way forced on us by the ()-less
123
- * definition of BEGIN.
124
- */
125
- #define BEGIN (yy_start) = 1 + 2 *
126
-
127
- /* Translate the current start state into a value that can be later handed
128
- * to BEGIN to return to the state. The YYSTATE alias is for lex
129
- * compatibility.
130
- */
131
- #define YY_START (((yy_start) - 1) / 2)
132
- #define YYSTATE YY_START
133
-
134
- /* Action number for EOF rule of a given start state. */
135
- #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136
-
137
- /* Special action meaning "start processing a new file". */
138
- #define YY_NEW_FILE yyrestart(yyin )
139
-
140
- #define YY_END_OF_BUFFER_CHAR 0
141
-
142
- /* Size of default input buffer. */
143
- #ifndef YY_BUF_SIZE
144
- #define YY_BUF_SIZE 16384
145
- #endif
146
-
147
- /* The state buf must be large enough to hold one state per character in the main buffer.
148
- */
149
- #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
150
-
151
- #ifndef YY_TYPEDEF_YY_BUFFER_STATE
152
- #define YY_TYPEDEF_YY_BUFFER_STATE
153
- typedef struct yy_buffer_state *YY_BUFFER_STATE;
154
- #endif
155
-
156
- #ifndef YY_TYPEDEF_YY_SIZE_T
157
- #define YY_TYPEDEF_YY_SIZE_T
158
- typedef size_t yy_size_t;
159
- #endif
160
-
161
- extern yy_size_t yyleng;
162
-
163
- extern FILE *yyin, *yyout;
164
-
165
- #define EOB_ACT_CONTINUE_SCAN 0
166
- #define EOB_ACT_END_OF_FILE 1
167
- #define EOB_ACT_LAST_MATCH 2
168
-
169
- /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
170
- * access to the local variable yy_act. Since yyless() is a macro, it would break
171
- * existing scanners that call yyless() from OUTSIDE yylex.
172
- * One obvious solution it to make yy_act a global. I tried that, and saw
173
- * a 5% performance hit in a non-yylineno scanner, because yy_act is
174
- * normally declared as a register variable-- so it is not worth it.
175
- */
176
- #define YY_LESS_LINENO(n) \
177
- do { \
178
- int yyl;\
179
- for ( yyl = n; yyl < yyleng; ++yyl )\
180
- if ( yytext[yyl] == '\n' )\
181
- --yylineno;\
182
- }while(0)
183
-
184
- /* Return all but the first "n" matched characters back to the input stream. */
185
- #define yyless(n) \
186
- do \
187
- { \
188
- /* Undo effects of setting up yytext. */ \
189
- int yyless_macro_arg = (n); \
190
- YY_LESS_LINENO(yyless_macro_arg);\
191
- *yy_cp = (yy_hold_char); \
192
- YY_RESTORE_YY_MORE_OFFSET \
193
- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
194
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
195
- } \
196
- while ( 0 )
197
-
198
- #define unput(c) yyunput( c, (yytext_ptr) )
199
-
200
- #ifndef YY_STRUCT_YY_BUFFER_STATE
201
- #define YY_STRUCT_YY_BUFFER_STATE
202
- struct yy_buffer_state
203
- {
204
- FILE *yy_input_file;
205
-
206
- char *yy_ch_buf; /* input buffer */
207
- char *yy_buf_pos; /* current position in input buffer */
208
-
209
- /* Size of input buffer in bytes, not including room for EOB
210
- * characters.
211
- */
212
- yy_size_t yy_buf_size;
213
-
214
- /* Number of characters read into yy_ch_buf, not including EOB
215
- * characters.
216
- */
217
- yy_size_t yy_n_chars;
218
-
219
- /* Whether we "own" the buffer - i.e., we know we created it,
220
- * and can realloc() it to grow it, and should free() it to
221
- * delete it.
222
- */
223
- int yy_is_our_buffer;
224
-
225
- /* Whether this is an "interactive" input source; if so, and
226
- * if we're using stdio for input, then we want to use getc()
227
- * instead of fread(), to make sure we stop fetching input after
228
- * each newline.
229
- */
230
- int yy_is_interactive;
231
-
232
- /* Whether we're considered to be at the beginning of a line.
233
- * If so, '^' rules will be active on the next match, otherwise
234
- * not.
235
- */
236
- int yy_at_bol;
237
-
238
- int yy_bs_lineno; /**< The line count. */
239
- int yy_bs_column; /**< The column count. */
240
-
241
- /* Whether to try to fill the input buffer when we reach the
242
- * end of it.
243
- */
244
- int yy_fill_buffer;
245
-
246
- int yy_buffer_status;
247
-
248
- #define YY_BUFFER_NEW 0
249
- #define YY_BUFFER_NORMAL 1
250
- /* When an EOF's been seen but there's still some text to process
251
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
252
- * shouldn't try reading from the input source any more. We might
253
- * still have a bunch of tokens to match, though, because of
254
- * possible backing-up.
255
- *
256
- * When we actually see the EOF, we change the status to "new"
257
- * (via yyrestart()), so that the user can continue scanning by
258
- * just pointing yyin at a new input file.
259
- */
260
- #define YY_BUFFER_EOF_PENDING 2
261
-
262
- };
263
- #endif /* !YY_STRUCT_YY_BUFFER_STATE */
264
-
265
- /* Stack of input buffers. */
266
- static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
267
- static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
268
- static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
269
-
270
- /* We provide macros for accessing buffer states in case in the
271
- * future we want to put the buffer states in a more general
272
- * "scanner state".
273
- *
274
- * Returns the top of the stack, or NULL.
275
- */
276
- #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
277
- ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
278
- : NULL)
279
-
280
- /* Same as previous macro, but useful when we know that the buffer stack is not
281
- * NULL or when we need an lvalue. For internal use only.
282
- */
283
- #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
284
-
285
- /* yy_hold_char holds the character lost when yytext is formed. */
286
- static char yy_hold_char;
287
- static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
288
- yy_size_t yyleng;
289
-
290
- /* Points to current character in buffer. */
291
- static char *yy_c_buf_p = (char *) 0;
292
- static int yy_init = 0; /* whether we need to initialize */
293
- static int yy_start = 0; /* start state number */
294
-
295
- /* Flag which is used to allow yywrap()'s to do buffer switches
296
- * instead of setting up a fresh yyin. A bit of a hack ...
297
- */
298
- static int yy_did_buffer_switch_on_eof;
299
-
300
- void yyrestart (FILE *input_file );
301
- void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
302
- YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
303
- void yy_delete_buffer (YY_BUFFER_STATE b );
304
- void yy_flush_buffer (YY_BUFFER_STATE b );
305
- void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
306
- void yypop_buffer_state (void );
307
-
308
- static void yyensure_buffer_stack (void );
309
- static void yy_load_buffer_state (void );
310
- static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
311
-
312
- #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
313
-
314
- YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
315
- YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
316
- YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
317
-
318
- void *yyalloc (yy_size_t );
319
- void *yyrealloc (void *,yy_size_t );
320
- void yyfree (void * );
321
-
322
- #define yy_new_buffer yy_create_buffer
323
-
324
- #define yy_set_interactive(is_interactive) \
325
- { \
326
- if ( ! YY_CURRENT_BUFFER ){ \
327
- yyensure_buffer_stack (); \
328
- YY_CURRENT_BUFFER_LVALUE = \
329
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
330
- } \
331
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
332
- }
333
-
334
- #define yy_set_bol(at_bol) \
335
- { \
336
- if ( ! YY_CURRENT_BUFFER ){\
337
- yyensure_buffer_stack (); \
338
- YY_CURRENT_BUFFER_LVALUE = \
339
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
340
- } \
341
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
342
- }
343
-
344
- #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
345
-
346
- typedef unsigned char YY_CHAR;
347
-
348
- FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
349
-
350
- typedef int yy_state_type;
351
-
352
- extern int yylineno;
353
-
354
- int yylineno = 1;
355
-
356
- extern char *yytext;
357
- #define yytext_ptr yytext
358
-
359
- static yy_state_type yy_get_previous_state (void );
360
- static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
361
- static int yy_get_next_buffer (void );
362
- static void yy_fatal_error (yyconst char msg[] );
363
-
364
- /* Done after the current pattern has been matched and before the
365
- * corresponding action - sets up yytext.
366
- */
367
- #define YY_DO_BEFORE_ACTION \
368
- (yytext_ptr) = yy_bp; \
369
- yyleng = (size_t) (yy_cp - yy_bp); \
370
- (yy_hold_char) = *yy_cp; \
371
- *yy_cp = '\0'; \
372
- (yy_c_buf_p) = yy_cp;
373
-
374
- #define YY_NUM_RULES 57
375
- #define YY_END_OF_BUFFER 58
376
- /* This struct is not used in this scanner,
377
- but its presence is necessary. */
378
- struct yy_trans_info
379
- {
380
- flex_int32_t yy_verify;
381
- flex_int32_t yy_nxt;
382
- };
383
- static yyconst flex_int16_t yy_accept[186] =
384
- { 0,
385
- 53, 53, 58, 56, 53, 55, 25, 56, 52, 51,
386
- 25, 56, 10, 11, 25, 47, 25, 50, 25, 6,
387
- 6, 49, 48, 25, 24, 12, 43, 43, 17, 56,
388
- 18, 39, 39, 39, 39, 39, 39, 39, 39, 39,
389
- 15, 21, 16, 53, 25, 42, 0, 8, 0, 52,
390
- 25, 41, 39, 40, 39, 45, 45, 45, 0, 0,
391
- 45, 0, 6, 23, 0, 25, 42, 25, 0, 6,
392
- 0, 0, 0, 0, 19, 22, 39, 13, 14, 43,
393
- 43, 40, 0, 0, 54, 20, 41, 39, 39, 39,
394
- 39, 39, 39, 39, 39, 39, 39, 25, 8, 0,
395
-
396
- 45, 45, 45, 45, 45, 0, 45, 46, 7, 5,
397
- 4, 3, 39, 39, 0, 39, 39, 39, 2, 39,
398
- 39, 39, 39, 39, 39, 39, 39, 29, 25, 0,
399
- 0, 0, 45, 45, 45, 44, 38, 39, 39, 39,
400
- 39, 39, 39, 39, 39, 39, 36, 39, 0, 45,
401
- 45, 45, 44, 44, 0, 30, 1, 39, 37, 39,
402
- 39, 39, 32, 39, 33, 9, 39, 39, 39, 39,
403
- 27, 31, 34, 39, 39, 39, 39, 28, 39, 35,
404
- 39, 39, 39, 26, 0
405
- } ;
406
-
407
- static yyconst flex_int32_t yy_ec[256] =
408
- { 0,
409
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
410
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412
- 1, 2, 4, 5, 6, 7, 4, 8, 9, 10,
413
- 11, 8, 12, 13, 14, 15, 16, 17, 18, 19,
414
- 19, 19, 19, 19, 19, 20, 20, 21, 22, 23,
415
- 24, 25, 4, 26, 27, 28, 27, 27, 27, 27,
416
- 29, 29, 29, 29, 29, 30, 29, 29, 31, 29,
417
- 29, 29, 29, 29, 29, 29, 29, 32, 29, 29,
418
- 33, 34, 35, 4, 36, 1, 37, 38, 39, 40,
419
-
420
- 41, 42, 43, 44, 45, 43, 43, 46, 47, 48,
421
- 49, 50, 51, 52, 53, 54, 55, 56, 43, 57,
422
- 58, 43, 59, 60, 61, 4, 1, 1, 1, 1,
423
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430
-
431
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436
- 1, 1, 1, 1, 1
437
- } ;
438
-
439
- static yyconst flex_int32_t yy_meta[62] =
440
- { 0,
441
- 1, 1, 2, 3, 1, 1, 1, 4, 1, 5,
442
- 1, 3, 1, 3, 1, 3, 6, 6, 6, 6,
443
- 7, 1, 3, 3, 3, 8, 9, 9, 10, 10,
444
- 10, 10, 11, 1, 1, 12, 13, 13, 13, 13,
445
- 13, 13, 14, 14, 14, 14, 14, 14, 14, 14,
446
- 14, 14, 14, 14, 14, 14, 14, 14, 15, 16,
447
- 1
448
- } ;
449
-
450
- static yyconst flex_int16_t yy_base[201] =
451
- { 0,
452
- 0, 0, 400, 813, 391, 813, 58, 58, 0, 813,
453
- 89, 122, 813, 813, 59, 813, 70, 813, 92, 168,
454
- 103, 813, 813, 61, 146, 39, 222, 255, 813, 388,
455
- 364, 288, 27, 347, 342, 348, 331, 339, 78, 315,
456
- 813, 306, 813, 363, 149, 813, 106, 358, 355, 0,
457
- 197, 813, 0, 813, 0, 321, 378, 0, 435, 316,
458
- 0, 290, 161, 225, 332, 258, 327, 291, 172, 237,
459
- 67, 110, 0, 267, 813, 345, 492, 65, 813, 336,
460
- 335, 318, 130, 335, 813, 813, 813, 78, 299, 292,
461
- 284, 277, 92, 98, 284, 278, 269, 316, 813, 161,
462
-
463
- 0, 0, 0, 0, 0, 297, 348, 306, 300, 150,
464
- 197, 0, 525, 0, 347, 280, 271, 255, 0, 269,
465
- 258, 238, 239, 235, 172, 247, 247, 0, 267, 189,
466
- 270, 262, 0, 458, 0, 558, 0, 220, 208, 207,
467
- 207, 207, 201, 195, 174, 179, 0, 176, 214, 0,
468
- 0, 0, 591, 0, 197, 0, 0, 166, 0, 156,
469
- 169, 151, 0, 154, 0, 813, 140, 152, 130, 136,
470
- 139, 0, 0, 110, 123, 96, 69, 813, 58, 0,
471
- 47, 38, 21, 0, 813, 627, 643, 657, 669, 683,
472
- 689, 703, 711, 724, 738, 749, 760, 772, 784, 798
473
-
474
- } ;
475
-
476
- static yyconst flex_int16_t yy_def[201] =
477
- { 0,
478
- 185, 1, 185, 185, 185, 185, 185, 186, 187, 185,
479
- 188, 189, 185, 185, 190, 185, 190, 185, 191, 185,
480
- 185, 185, 185, 192, 185, 193, 194, 194, 185, 195,
481
- 185, 188, 32, 32, 32, 32, 32, 32, 32, 32,
482
- 185, 185, 185, 185, 185, 185, 186, 185, 186, 187,
483
- 32, 185, 32, 185, 32, 189, 185, 56, 189, 185,
484
- 57, 185, 185, 185, 191, 191, 191, 191, 185, 185,
485
- 185, 185, 196, 185, 185, 185, 197, 193, 185, 28,
486
- 28, 185, 186, 195, 185, 185, 185, 32, 32, 32,
487
- 32, 32, 32, 32, 32, 32, 32, 198, 185, 199,
488
-
489
- 57, 57, 57, 57, 57, 59, 56, 191, 185, 185,
490
- 185, 196, 197, 113, 185, 32, 32, 32, 32, 32,
491
- 32, 32, 32, 32, 32, 32, 32, 32, 198, 199,
492
- 185, 199, 107, 57, 134, 200, 32, 32, 32, 32,
493
- 32, 32, 32, 32, 32, 32, 32, 32, 185, 134,
494
- 134, 134, 200, 153, 185, 32, 32, 32, 32, 32,
495
- 32, 32, 32, 32, 32, 185, 32, 32, 32, 32,
496
- 32, 32, 32, 32, 32, 32, 32, 185, 32, 32,
497
- 32, 32, 32, 32, 0, 185, 185, 185, 185, 185,
498
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185
499
-
500
- } ;
501
-
502
- static yyconst flex_int16_t yy_nxt[875] =
503
- { 0,
504
- 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
505
- 14, 15, 16, 17, 18, 19, 20, 21, 21, 21,
506
- 22, 23, 24, 25, 7, 26, 27, 27, 27, 28,
507
- 27, 27, 29, 30, 31, 32, 32, 32, 33, 34,
508
- 32, 35, 32, 32, 32, 32, 36, 32, 32, 37,
509
- 32, 38, 39, 40, 32, 32, 32, 32, 41, 42,
510
- 43, 45, 48, 88, 78, 45, 184, 46, 46, 45,
511
- 46, 45, 89, 45, 183, 63, 63, 63, 63, 46,
512
- 45, 45, 45, 110, 110, 182, 63, 63, 63, 63,
513
- 185, 49, 51, 75, 64, 66, 51, 79, 52, 66,
514
-
515
- 51, 67, 51, 66, 51, 66, 181, 68, 180, 54,
516
- 99, 51, 51, 51, 66, 66, 66, 69, 95, 70,
517
- 70, 70, 70, 185, 55, 56, 111, 111, 111, 57,
518
- 116, 117, 96, 56, 48, 56, 122, 56, 74, 49,
519
- 123, 179, 58, 178, 56, 56, 56, 59, 124, 45,
520
- 177, 125, 45, 45, 60, 46, 45, 45, 46, 45,
521
- 45, 45, 45, 49, 45, 131, 110, 110, 45, 45,
522
- 76, 45, 45, 45, 176, 69, 175, 70, 70, 70,
523
- 70, 62, 69, 174, 70, 70, 70, 70, 109, 109,
524
- 109, 109, 173, 131, 132, 71, 74, 172, 72, 73,
525
-
526
- 51, 171, 170, 74, 51, 71, 52, 169, 51, 168,
527
- 51, 167, 51, 111, 111, 111, 72, 115, 166, 51,
528
- 51, 51, 132, 145, 73, 80, 146, 165, 45, 80,
529
- 164, 163, 45, 80, 46, 80, 45, 80, 45, 162,
530
- 45, 161, 82, 160, 80, 80, 80, 45, 45, 45,
531
- 159, 69, 158, 70, 70, 70, 70, 80, 80, 83,
532
- 157, 66, 80, 156, 185, 66, 80, 67, 80, 66,
533
- 80, 66, 74, 68, 149, 82, 46, 80, 80, 80,
534
- 66, 66, 66, 70, 70, 70, 70, 148, 147, 144,
535
- 80, 55, 143, 142, 66, 55, 141, 87, 66, 55,
536
-
537
- 67, 55, 66, 55, 66, 140, 68, 139, 54, 138,
538
- 55, 55, 55, 66, 66, 66, 109, 109, 109, 109,
539
- 137, 108, 185, 55, 56, 46, 128, 127, 57, 126,
540
- 121, 120, 56, 119, 56, 118, 56, 85, 115, 185,
541
- 185, 58, 108, 56, 56, 56, 59, 108, 45, 107,
542
- 58, 133, 45, 60, 46, 134, 45, 185, 45, 133,
543
- 45, 133, 100, 133, 44, 98, 97, 45, 45, 45,
544
- 133, 133, 133, 136, 136, 136, 136, 136, 136, 94,
545
- 62, 101, 93, 135, 92, 102, 91, 90, 86, 101,
546
- 85, 101, 44, 101, 103, 103, 103, 103, 58, 185,
547
-
548
- 101, 101, 101, 59, 103, 103, 103, 103, 103, 103,
549
- 60, 185, 185, 104, 105, 105, 105, 105, 105, 105,
550
- 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
551
- 105, 105, 105, 105, 105, 105, 185, 62, 185, 185,
552
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
553
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
554
- 106, 150, 185, 185, 185, 151, 185, 185, 185, 150,
555
- 185, 150, 185, 150, 185, 185, 185, 185, 185, 185,
556
- 150, 150, 150, 185, 185, 185, 185, 185, 185, 185,
557
- 185, 185, 185, 152, 185, 113, 185, 185, 185, 113,
558
-
559
- 185, 87, 185, 113, 185, 113, 185, 113, 185, 185,
560
- 185, 185, 185, 185, 113, 113, 113, 185, 185, 185,
561
- 185, 185, 185, 185, 185, 185, 185, 113, 113, 185,
562
- 185, 185, 113, 185, 87, 185, 113, 185, 113, 185,
563
- 113, 185, 185, 185, 185, 185, 185, 113, 113, 113,
564
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
565
- 113, 153, 185, 185, 185, 153, 185, 185, 185, 153,
566
- 185, 153, 185, 153, 185, 185, 185, 185, 155, 185,
567
- 153, 153, 153, 185, 185, 185, 185, 185, 185, 185,
568
- 185, 185, 185, 153, 153, 185, 185, 185, 153, 185,
569
-
570
- 185, 185, 153, 185, 153, 185, 153, 185, 185, 185,
571
- 185, 155, 185, 153, 153, 153, 185, 185, 185, 185,
572
- 185, 185, 185, 185, 185, 185, 153, 47, 47, 47,
573
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
574
- 47, 47, 47, 50, 185, 50, 50, 50, 50, 50,
575
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 53,
576
- 53, 53, 53, 53, 185, 53, 53, 185, 53, 53,
577
- 53, 61, 61, 185, 185, 61, 61, 185, 185, 61,
578
- 61, 61, 61, 185, 61, 45, 45, 45, 45, 65,
579
- 185, 65, 65, 65, 65, 65, 65, 65, 65, 65,
580
-
581
- 65, 65, 65, 65, 65, 45, 45, 45, 185, 185,
582
- 185, 185, 185, 45, 77, 185, 185, 185, 77, 185,
583
- 185, 185, 77, 77, 77, 77, 81, 81, 185, 81,
584
- 81, 185, 81, 81, 185, 81, 81, 81, 84, 84,
585
- 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
586
- 84, 84, 84, 84, 112, 185, 185, 112, 185, 185,
587
- 185, 112, 114, 114, 114, 114, 185, 185, 114, 114,
588
- 185, 114, 114, 114, 129, 129, 129, 185, 185, 185,
589
- 185, 185, 185, 129, 130, 130, 130, 130, 130, 130,
590
- 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
591
-
592
- 154, 154, 185, 154, 154, 185, 154, 154, 185, 154,
593
- 154, 154, 3, 185, 185, 185, 185, 185, 185, 185,
594
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
595
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
596
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
597
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
598
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
599
- 185, 185, 185, 185
600
- } ;
601
-
602
- static yyconst flex_int16_t yy_chk[875] =
603
- { 0,
604
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
605
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
606
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
607
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
608
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
609
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
610
- 1, 7, 8, 33, 26, 7, 183, 7, 15, 7,
611
- 24, 7, 33, 7, 182, 15, 15, 15, 15, 17,
612
- 7, 7, 7, 71, 71, 181, 17, 17, 17, 17,
613
- 78, 8, 11, 24, 17, 19, 11, 26, 11, 19,
614
-
615
- 11, 19, 11, 19, 11, 19, 179, 19, 177, 11,
616
- 47, 11, 11, 11, 19, 19, 19, 21, 39, 21,
617
- 21, 21, 21, 78, 11, 12, 72, 72, 72, 12,
618
- 88, 88, 39, 12, 83, 12, 93, 12, 21, 47,
619
- 93, 176, 12, 175, 12, 12, 12, 12, 94, 25,
620
- 174, 94, 45, 25, 12, 25, 45, 25, 45, 25,
621
- 45, 25, 45, 83, 45, 100, 110, 110, 25, 25,
622
- 25, 45, 45, 45, 171, 63, 170, 63, 63, 63,
623
- 63, 12, 20, 169, 20, 20, 20, 20, 69, 69,
624
- 69, 69, 168, 130, 100, 20, 63, 167, 20, 20,
625
-
626
- 51, 164, 162, 20, 51, 20, 51, 161, 51, 160,
627
- 51, 158, 51, 111, 111, 111, 20, 155, 149, 51,
628
- 51, 51, 130, 125, 20, 27, 125, 148, 64, 27,
629
- 146, 145, 64, 27, 64, 27, 64, 27, 64, 144,
630
- 64, 143, 27, 142, 27, 27, 27, 64, 64, 64,
631
- 141, 70, 140, 70, 70, 70, 70, 27, 28, 28,
632
- 139, 66, 28, 138, 132, 66, 28, 66, 28, 66,
633
- 28, 66, 70, 66, 131, 28, 129, 28, 28, 28,
634
- 66, 66, 66, 74, 74, 74, 74, 127, 126, 124,
635
- 28, 32, 123, 122, 68, 32, 121, 32, 68, 32,
636
-
637
- 68, 32, 68, 32, 68, 120, 68, 118, 32, 117,
638
- 32, 32, 32, 68, 68, 68, 109, 109, 109, 109,
639
- 116, 108, 106, 32, 56, 98, 97, 96, 56, 95,
640
- 92, 91, 56, 90, 56, 89, 56, 84, 82, 81,
641
- 80, 56, 67, 56, 56, 56, 56, 65, 76, 62,
642
- 60, 107, 76, 56, 76, 107, 76, 49, 76, 107,
643
- 76, 107, 48, 107, 44, 42, 40, 76, 76, 76,
644
- 107, 107, 107, 115, 115, 115, 115, 115, 115, 38,
645
- 56, 57, 37, 107, 36, 57, 35, 34, 31, 57,
646
- 30, 57, 5, 57, 57, 57, 57, 57, 57, 3,
647
-
648
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
649
- 57, 0, 0, 57, 57, 57, 57, 57, 57, 57,
650
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
651
- 57, 57, 57, 57, 57, 57, 0, 57, 59, 0,
652
- 0, 0, 0, 0, 0, 0, 59, 0, 59, 0,
653
- 59, 0, 0, 0, 0, 59, 0, 59, 59, 59,
654
- 59, 134, 0, 0, 0, 134, 0, 59, 0, 134,
655
- 0, 134, 0, 134, 0, 0, 0, 0, 0, 0,
656
- 134, 134, 134, 0, 0, 0, 0, 0, 0, 0,
657
- 0, 0, 0, 134, 59, 77, 0, 0, 0, 77,
658
-
659
- 0, 77, 0, 77, 0, 77, 0, 77, 0, 0,
660
- 0, 0, 0, 0, 77, 77, 77, 0, 0, 0,
661
- 0, 0, 0, 0, 0, 0, 0, 77, 113, 0,
662
- 0, 0, 113, 0, 113, 0, 113, 0, 113, 0,
663
- 113, 0, 0, 0, 0, 0, 0, 113, 113, 113,
664
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
665
- 113, 136, 0, 0, 0, 136, 0, 0, 0, 136,
666
- 0, 136, 0, 136, 0, 0, 0, 0, 136, 0,
667
- 136, 136, 136, 0, 0, 0, 0, 0, 0, 0,
668
- 0, 0, 0, 136, 153, 0, 0, 0, 153, 0,
669
-
670
- 0, 0, 153, 0, 153, 0, 153, 0, 0, 0,
671
- 0, 153, 0, 153, 153, 153, 0, 0, 0, 0,
672
- 0, 0, 0, 0, 0, 0, 153, 186, 186, 186,
673
- 186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
674
- 186, 186, 186, 187, 0, 187, 187, 187, 187, 187,
675
- 187, 187, 187, 187, 187, 187, 187, 187, 187, 188,
676
- 188, 188, 188, 188, 0, 188, 188, 0, 188, 188,
677
- 188, 189, 189, 0, 0, 189, 189, 0, 0, 189,
678
- 189, 189, 189, 0, 189, 190, 190, 190, 190, 191,
679
- 0, 191, 191, 191, 191, 191, 191, 191, 191, 191,
680
-
681
- 191, 191, 191, 191, 191, 192, 192, 192, 0, 0,
682
- 0, 0, 0, 192, 193, 0, 0, 0, 193, 0,
683
- 0, 0, 193, 193, 193, 193, 194, 194, 0, 194,
684
- 194, 0, 194, 194, 0, 194, 194, 194, 195, 195,
685
- 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
686
- 195, 195, 195, 195, 196, 0, 0, 196, 0, 0,
687
- 0, 196, 197, 197, 197, 197, 0, 0, 197, 197,
688
- 0, 197, 197, 197, 198, 198, 198, 0, 0, 0,
689
- 0, 0, 0, 198, 199, 199, 199, 199, 199, 199,
690
- 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
691
-
692
- 200, 200, 0, 200, 200, 0, 200, 200, 0, 200,
693
- 200, 200, 185, 185, 185, 185, 185, 185, 185, 185,
694
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
695
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
696
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
697
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
698
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
699
- 185, 185, 185, 185
700
- } ;
701
-
702
- /* Table of booleans, true if rule could match eol. */
703
- static yyconst flex_int32_t yy_rule_can_match_eol[58] =
704
- { 0,
705
- 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
706
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
707
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, };
708
-
709
- static yy_state_type yy_last_accepting_state;
710
- static char *yy_last_accepting_cpos;
711
-
712
- extern int yy_flex_debug;
713
- int yy_flex_debug = 0;
714
-
715
- /* The intent behind this definition is that it'll catch
716
- * any uses of REJECT which flex missed.
717
- */
718
- #define REJECT reject_used_but_not_detected
719
- #define yymore() yymore_used_but_not_detected
720
- #define YY_MORE_ADJ 0
721
- #define YY_RESTORE_YY_MORE_OFFSET
722
- char *yytext;
723
- #line 1 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
724
- #line 2 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
725
- #include "ruby.h"
726
- #include "parser.h"
727
-
728
- int yyerror(char *s);
729
- #line 730 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.c"
730
-
731
- #define INITIAL 0
732
-
733
- #ifndef YY_NO_UNISTD_H
734
- /* Special case for "unistd.h", since it is non-ANSI. We include it way
735
- * down here because we want the user's section 1 to have been scanned first.
736
- * The user has a chance to override it with an option.
737
- */
738
- #include <unistd.h>
739
- #endif
740
-
741
- #ifndef YY_EXTRA_TYPE
742
- #define YY_EXTRA_TYPE void *
743
- #endif
744
-
745
- static int yy_init_globals (void );
746
-
747
- /* Accessor methods to globals.
748
- These are made visible to non-reentrant scanners for convenience. */
749
-
750
- int yylex_destroy (void );
751
-
752
- int yyget_debug (void );
753
-
754
- void yyset_debug (int debug_flag );
755
-
756
- YY_EXTRA_TYPE yyget_extra (void );
757
-
758
- void yyset_extra (YY_EXTRA_TYPE user_defined );
759
-
760
- FILE *yyget_in (void );
761
-
762
- void yyset_in (FILE * in_str );
763
-
764
- FILE *yyget_out (void );
765
-
766
- void yyset_out (FILE * out_str );
767
-
768
- yy_size_t yyget_leng (void );
769
-
770
- char *yyget_text (void );
771
-
772
- int yyget_lineno (void );
773
-
774
- void yyset_lineno (int line_number );
775
-
776
- /* Macros after this point can all be overridden by user definitions in
777
- * section 1.
778
- */
779
-
780
- #ifndef YY_SKIP_YYWRAP
781
- #ifdef __cplusplus
782
- extern "C" int yywrap (void );
783
- #else
784
- extern int yywrap (void );
785
- #endif
786
- #endif
787
-
788
- static void yyunput (int c,char *buf_ptr );
789
-
790
- #ifndef yytext_ptr
791
- static void yy_flex_strncpy (char *,yyconst char *,int );
792
- #endif
793
-
794
- #ifdef YY_NEED_STRLEN
795
- static int yy_flex_strlen (yyconst char * );
796
- #endif
797
-
798
- #ifndef YY_NO_INPUT
799
-
800
- #ifdef __cplusplus
801
- static int yyinput (void );
802
- #else
803
- static int input (void );
804
- #endif
805
-
806
- #endif
807
-
808
- /* Amount of stuff to slurp up with each read. */
809
- #ifndef YY_READ_BUF_SIZE
810
- #define YY_READ_BUF_SIZE 8192
811
- #endif
812
-
813
- /* Copy whatever the last rule matched to the standard output. */
814
- #ifndef ECHO
815
- /* This used to be an fputs(), but since the string might contain NUL's,
816
- * we now use fwrite().
817
- */
818
- #define ECHO fwrite( yytext, yyleng, 1, yyout )
819
- #endif
820
-
821
- /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
822
- * is returned in "result".
823
- */
824
- #ifndef YY_INPUT
825
- #define YY_INPUT(buf,result,max_size) \
826
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
827
- { \
828
- int c = '*'; \
829
- yy_size_t n; \
830
- for ( n = 0; n < max_size && \
831
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
832
- buf[n] = (char) c; \
833
- if ( c == '\n' ) \
834
- buf[n++] = (char) c; \
835
- if ( c == EOF && ferror( yyin ) ) \
836
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
837
- result = n; \
838
- } \
839
- else \
840
- { \
841
- errno=0; \
842
- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
843
- { \
844
- if( errno != EINTR) \
845
- { \
846
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
847
- break; \
848
- } \
849
- errno=0; \
850
- clearerr(yyin); \
851
- } \
852
- }\
853
- \
854
-
855
- #endif
856
-
857
- /* No semi-colon after return; correct usage is to write "yyterminate();" -
858
- * we don't want an extra ';' after the "return" because that will cause
859
- * some compilers to complain about unreachable statements.
860
- */
861
- #ifndef yyterminate
862
- #define yyterminate() return YY_NULL
863
- #endif
864
-
865
- /* Number of entries by which start-condition stack grows. */
866
- #ifndef YY_START_STACK_INCR
867
- #define YY_START_STACK_INCR 25
868
- #endif
869
-
870
- /* Report a fatal error. */
871
- #ifndef YY_FATAL_ERROR
872
- #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
873
- #endif
874
-
875
- /* end tables serialization structures and prototypes */
876
-
877
- /* Default declaration of generated scanner - a define so the user can
878
- * easily add parameters.
879
- */
880
- #ifndef YY_DECL
881
- #define YY_DECL_IS_OURS 1
882
-
883
- extern int yylex (void);
884
-
885
- #define YY_DECL int yylex (void)
886
- #endif /* !YY_DECL */
887
-
888
- /* Code executed at the beginning of each rule, after yytext and yyleng
889
- * have been set up.
890
- */
891
- #ifndef YY_USER_ACTION
892
- #define YY_USER_ACTION
893
- #endif
894
-
895
- /* Code executed at the end of each rule. */
896
- #ifndef YY_BREAK
897
- #define YY_BREAK break;
898
- #endif
899
-
900
- #define YY_RULE_SETUP \
901
- YY_USER_ACTION
902
-
903
- /** The main scanner function which does all the work.
904
- */
905
- YY_DECL
906
- {
907
- register yy_state_type yy_current_state;
908
- register char *yy_cp, *yy_bp;
909
- register int yy_act;
910
-
911
- #line 75 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
912
-
913
-
914
- #line 915 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.c"
915
-
916
- if ( !(yy_init) )
917
- {
918
- (yy_init) = 1;
919
-
920
- #ifdef YY_USER_INIT
921
- YY_USER_INIT;
922
- #endif
923
-
924
- if ( ! (yy_start) )
925
- (yy_start) = 1; /* first start state */
926
-
927
- if ( ! yyin )
928
- yyin = stdin;
929
-
930
- if ( ! yyout )
931
- yyout = stdout;
932
-
933
- if ( ! YY_CURRENT_BUFFER ) {
934
- yyensure_buffer_stack ();
935
- YY_CURRENT_BUFFER_LVALUE =
936
- yy_create_buffer(yyin,YY_BUF_SIZE );
937
- }
938
-
939
- yy_load_buffer_state( );
940
- }
941
-
942
- while ( 1 ) /* loops until end-of-file is reached */
943
- {
944
- yy_cp = (yy_c_buf_p);
945
-
946
- /* Support of yytext. */
947
- *yy_cp = (yy_hold_char);
948
-
949
- /* yy_bp points to the position in yy_ch_buf of the start of
950
- * the current run.
951
- */
952
- yy_bp = yy_cp;
953
-
954
- yy_current_state = (yy_start);
955
- yy_match:
956
- do
957
- {
958
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
959
- if ( yy_accept[yy_current_state] )
960
- {
961
- (yy_last_accepting_state) = yy_current_state;
962
- (yy_last_accepting_cpos) = yy_cp;
963
- }
964
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
965
- {
966
- yy_current_state = (int) yy_def[yy_current_state];
967
- if ( yy_current_state >= 186 )
968
- yy_c = yy_meta[(unsigned int) yy_c];
969
- }
970
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
971
- ++yy_cp;
972
- }
973
- while ( yy_base[yy_current_state] != 813 );
974
-
975
- yy_find_action:
976
- yy_act = yy_accept[yy_current_state];
977
- if ( yy_act == 0 )
978
- { /* have to back up */
979
- yy_cp = (yy_last_accepting_cpos);
980
- yy_current_state = (yy_last_accepting_state);
981
- yy_act = yy_accept[yy_current_state];
982
- }
983
-
984
- YY_DO_BEFORE_ACTION;
985
-
986
- if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
987
- {
988
- int yyl;
989
- for ( yyl = 0; yyl < yyleng; ++yyl )
990
- if ( yytext[yyl] == '\n' )
991
-
992
- yylineno++;
993
- ;
994
- }
995
-
996
- do_action: /* This label is used only to access EOF actions. */
997
-
998
- switch ( yy_act )
999
- { /* beginning of action switch */
1000
- case 0: /* must back up */
1001
- /* undo the effects of YY_DO_BEFORE_ACTION */
1002
- *yy_cp = (yy_hold_char);
1003
- yy_cp = (yy_last_accepting_cpos);
1004
- yy_current_state = (yy_last_accepting_state);
1005
- goto yy_find_action;
1006
-
1007
- case 1:
1008
- YY_RULE_SETUP
1009
- #line 77 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1010
- { return CLASS; }
1011
- YY_BREAK
1012
- case 2:
1013
- YY_RULE_SETUP
1014
- #line 78 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1015
- { return DEF; }
1016
- YY_BREAK
1017
- case 3:
1018
- YY_RULE_SETUP
1019
- #line 79 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1020
- {
1021
- yylval.object = rb_str_new2(yytext);
1022
- return HEX_LITERAL;
1023
- }
1024
- YY_BREAK
1025
- case 4:
1026
- YY_RULE_SETUP
1027
- #line 83 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1028
- {
1029
- yylval.object = rb_str_new2(yytext);
1030
- return OCT_LITERAL;
1031
- }
1032
- YY_BREAK
1033
- case 5:
1034
- YY_RULE_SETUP
1035
- #line 87 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1036
- {
1037
- yylval.object = rb_str_new2(yytext);
1038
- return BIN_LITERAL;
1039
- }
1040
- YY_BREAK
1041
- case 6:
1042
- YY_RULE_SETUP
1043
- #line 91 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1044
- {
1045
- yylval.object = rb_str_new2(yytext);
1046
- return INTEGER_LITERAL;
1047
- }
1048
- YY_BREAK
1049
- case 7:
1050
- YY_RULE_SETUP
1051
- #line 95 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1052
- {
1053
- yylval.object = rb_str_new2(yytext);
1054
- return DOUBLE_LITERAL;
1055
- }
1056
- YY_BREAK
1057
- case 8:
1058
- /* rule 8 can match eol */
1059
- YY_RULE_SETUP
1060
- #line 99 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1061
- {
1062
- yylval.object = rb_str_new2(yytext);
1063
- return STRING_LITERAL;
1064
- }
1065
- YY_BREAK
1066
- case 9:
1067
- /* rule 9 can match eol */
1068
- YY_RULE_SETUP
1069
- #line 103 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1070
- {
1071
- yylval.object = rb_str_new2(yytext);
1072
- return MULTI_STRING_LITERAL;
1073
- }
1074
- YY_BREAK
1075
- case 10:
1076
- YY_RULE_SETUP
1077
- #line 107 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1078
- { return LPAREN; }
1079
- YY_BREAK
1080
- case 11:
1081
- YY_RULE_SETUP
1082
- #line 108 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1083
- { return RPAREN; }
1084
- YY_BREAK
1085
- case 12:
1086
- YY_RULE_SETUP
1087
- #line 109 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1088
- { return FUTURE_SEND; }
1089
- YY_BREAK
1090
- case 13:
1091
- YY_RULE_SETUP
1092
- #line 110 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1093
- { return ASYNC_SEND; }
1094
- YY_BREAK
1095
- case 14:
1096
- YY_RULE_SETUP
1097
- #line 111 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1098
- { return AT_LCURLY; }
1099
- YY_BREAK
1100
- case 15:
1101
- YY_RULE_SETUP
1102
- #line 112 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1103
- { return LCURLY; }
1104
- YY_BREAK
1105
- case 16:
1106
- YY_RULE_SETUP
1107
- #line 113 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1108
- { return RCURLY; }
1109
- YY_BREAK
1110
- case 17:
1111
- YY_RULE_SETUP
1112
- #line 114 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1113
- { return LBRACKET; }
1114
- YY_BREAK
1115
- case 18:
1116
- YY_RULE_SETUP
1117
- #line 115 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1118
- { return RBRACKET; }
1119
- YY_BREAK
1120
- case 19:
1121
- YY_RULE_SETUP
1122
- #line 116 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1123
- { return LHASH; }
1124
- YY_BREAK
1125
- case 20:
1126
- YY_RULE_SETUP
1127
- #line 117 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1128
- { return RHASH; }
1129
- YY_BREAK
1130
- case 21:
1131
- YY_RULE_SETUP
1132
- #line 118 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1133
- { return STAB; }
1134
- YY_BREAK
1135
- case 22:
1136
- YY_RULE_SETUP
1137
- #line 119 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1138
- { return ARROW; }
1139
- YY_BREAK
1140
- case 23:
1141
- YY_RULE_SETUP
1142
- #line 120 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1143
- { return THIN_ARROW; }
1144
- YY_BREAK
1145
- case 24:
1146
- YY_RULE_SETUP
1147
- #line 121 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1148
- { return EQUALS; }
1149
- YY_BREAK
1150
- case 25:
1151
- YY_RULE_SETUP
1152
- #line 122 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1153
- {
1154
- yylval.object = rb_str_new2(yytext);
1155
- return OPERATOR;
1156
- }
1157
- YY_BREAK
1158
- case 26:
1159
- YY_RULE_SETUP
1160
- #line 126 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1161
- { return RETURN_LOCAL; }
1162
- YY_BREAK
1163
- case 27:
1164
- YY_RULE_SETUP
1165
- #line 127 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1166
- { return RETURN; }
1167
- YY_BREAK
1168
- case 28:
1169
- YY_RULE_SETUP
1170
- #line 128 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1171
- { return REQUIRE; }
1172
- YY_BREAK
1173
- case 29:
1174
- YY_RULE_SETUP
1175
- #line 129 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1176
- { return TRY; }
1177
- YY_BREAK
1178
- case 30:
1179
- YY_RULE_SETUP
1180
- #line 130 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1181
- { return CATCH; }
1182
- YY_BREAK
1183
- case 31:
1184
- YY_RULE_SETUP
1185
- #line 131 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1186
- { return FINALLY; }
1187
- YY_BREAK
1188
- case 32:
1189
- YY_RULE_SETUP
1190
- #line 132 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1191
- { return RETRY; }
1192
- YY_BREAK
1193
- case 33:
1194
- YY_RULE_SETUP
1195
- #line 133 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1196
- { return SUPER; }
1197
- YY_BREAK
1198
- case 34:
1199
- YY_RULE_SETUP
1200
- #line 134 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1201
- { return PRIVATE; }
1202
- YY_BREAK
1203
- case 35:
1204
- YY_RULE_SETUP
1205
- #line 135 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1206
- { return PROTECTED; }
1207
- YY_BREAK
1208
- case 36:
1209
- YY_RULE_SETUP
1210
- #line 136 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1211
- {
1212
- yylval.object = rb_str_new2(yytext);
1213
- return IDENTIFIER;
1214
- }
1215
- YY_BREAK
1216
- case 37:
1217
- YY_RULE_SETUP
1218
- #line 140 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1219
- {
1220
- return MATCH;
1221
- }
1222
- YY_BREAK
1223
- case 38:
1224
- YY_RULE_SETUP
1225
- #line 143 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1226
- {
1227
- return CASE;
1228
- }
1229
- YY_BREAK
1230
- case 39:
1231
- YY_RULE_SETUP
1232
- #line 146 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1233
- {
1234
- yylval.object = rb_str_new2(yytext);
1235
- return IDENTIFIER;
1236
- }
1237
- YY_BREAK
1238
- case 40:
1239
- YY_RULE_SETUP
1240
- #line 150 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1241
- {
1242
- yylval.object = rb_str_new2(yytext);
1243
- return SELECTOR;
1244
- }
1245
- YY_BREAK
1246
- case 41:
1247
- YY_RULE_SETUP
1248
- #line 154 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1249
- {
1250
- yylval.object = rb_str_new2(yytext);
1251
- return RUBY_SEND_OPEN;
1252
- }
1253
- YY_BREAK
1254
- case 42:
1255
- YY_RULE_SETUP
1256
- #line 158 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1257
- {
1258
- yylval.object = rb_str_new2(yytext);
1259
- return RUBY_OPER_OPEN;
1260
- }
1261
- YY_BREAK
1262
- case 43:
1263
- YY_RULE_SETUP
1264
- #line 162 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1265
- {
1266
- yylval.object = rb_str_new2(yytext);
1267
- return CONSTANT;
1268
- }
1269
- YY_BREAK
1270
- case 44:
1271
- YY_RULE_SETUP
1272
- #line 166 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1273
- {
1274
- yylval.object = rb_str_new2(yytext);
1275
- return CONSTANT;
1276
- }
1277
- YY_BREAK
1278
- case 45:
1279
- YY_RULE_SETUP
1280
- #line 170 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1281
- {
1282
- yylval.object = rb_str_new2(yytext);
1283
- return SYMBOL_LITERAL;
1284
- }
1285
- YY_BREAK
1286
- case 46:
1287
- YY_RULE_SETUP
1288
- #line 174 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1289
- {
1290
- yylval.object = rb_str_new2(yytext);
1291
- return REGEX_LITERAL;
1292
- }
1293
- YY_BREAK
1294
- case 47:
1295
- YY_RULE_SETUP
1296
- #line 178 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1297
- { return COMMA; }
1298
- YY_BREAK
1299
- case 48:
1300
- YY_RULE_SETUP
1301
- #line 179 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1302
- { return SEMI; }
1303
- YY_BREAK
1304
- case 49:
1305
- YY_RULE_SETUP
1306
- #line 180 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1307
- { return COLON; }
1308
- YY_BREAK
1309
- case 50:
1310
- YY_RULE_SETUP
1311
- #line 181 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1312
- { return DOT; }
1313
- YY_BREAK
1314
- case 51:
1315
- YY_RULE_SETUP
1316
- #line 182 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1317
- { return DOLLAR; }
1318
- YY_BREAK
1319
- case 52:
1320
- YY_RULE_SETUP
1321
- #line 184 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1322
- {}
1323
- YY_BREAK
1324
- case 53:
1325
- YY_RULE_SETUP
1326
- #line 186 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1327
- {}
1328
- YY_BREAK
1329
- case 54:
1330
- /* rule 54 can match eol */
1331
- YY_RULE_SETUP
1332
- #line 187 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1333
- {}
1334
- YY_BREAK
1335
- case 55:
1336
- /* rule 55 can match eol */
1337
- YY_RULE_SETUP
1338
- #line 188 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1339
- { return NL; }
1340
- YY_BREAK
1341
- case 56:
1342
- YY_RULE_SETUP
1343
- #line 190 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1344
- { fprintf(stderr, "SCANNER %d", yyerror("")); exit(1); }
1345
- YY_BREAK
1346
- case 57:
1347
- YY_RULE_SETUP
1348
- #line 192 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"
1349
- ECHO;
1350
- YY_BREAK
1351
- #line 1352 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.c"
1352
- case YY_STATE_EOF(INITIAL):
1353
- yyterminate();
1354
-
1355
- case YY_END_OF_BUFFER:
1356
- {
1357
- /* Amount of text matched not including the EOB char. */
1358
- int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1359
-
1360
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
1361
- *yy_cp = (yy_hold_char);
1362
- YY_RESTORE_YY_MORE_OFFSET
1363
-
1364
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1365
- {
1366
- /* We're scanning a new file or input source. It's
1367
- * possible that this happened because the user
1368
- * just pointed yyin at a new source and called
1369
- * yylex(). If so, then we have to assure
1370
- * consistency between YY_CURRENT_BUFFER and our
1371
- * globals. Here is the right place to do so, because
1372
- * this is the first action (other than possibly a
1373
- * back-up) that will match for the new input source.
1374
- */
1375
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1376
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1377
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1378
- }
1379
-
1380
- /* Note that here we test for yy_c_buf_p "<=" to the position
1381
- * of the first EOB in the buffer, since yy_c_buf_p will
1382
- * already have been incremented past the NUL character
1383
- * (since all states make transitions on EOB to the
1384
- * end-of-buffer state). Contrast this with the test
1385
- * in input().
1386
- */
1387
- if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1388
- { /* This was really a NUL. */
1389
- yy_state_type yy_next_state;
1390
-
1391
- (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1392
-
1393
- yy_current_state = yy_get_previous_state( );
1394
-
1395
- /* Okay, we're now positioned to make the NUL
1396
- * transition. We couldn't have
1397
- * yy_get_previous_state() go ahead and do it
1398
- * for us because it doesn't know how to deal
1399
- * with the possibility of jamming (and we don't
1400
- * want to build jamming into it because then it
1401
- * will run more slowly).
1402
- */
1403
-
1404
- yy_next_state = yy_try_NUL_trans( yy_current_state );
1405
-
1406
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1407
-
1408
- if ( yy_next_state )
1409
- {
1410
- /* Consume the NUL. */
1411
- yy_cp = ++(yy_c_buf_p);
1412
- yy_current_state = yy_next_state;
1413
- goto yy_match;
1414
- }
1415
-
1416
- else
1417
- {
1418
- yy_cp = (yy_c_buf_p);
1419
- goto yy_find_action;
1420
- }
1421
- }
1422
-
1423
- else switch ( yy_get_next_buffer( ) )
1424
- {
1425
- case EOB_ACT_END_OF_FILE:
1426
- {
1427
- (yy_did_buffer_switch_on_eof) = 0;
1428
-
1429
- if ( yywrap( ) )
1430
- {
1431
- /* Note: because we've taken care in
1432
- * yy_get_next_buffer() to have set up
1433
- * yytext, we can now set up
1434
- * yy_c_buf_p so that if some total
1435
- * hoser (like flex itself) wants to
1436
- * call the scanner after we return the
1437
- * YY_NULL, it'll still work - another
1438
- * YY_NULL will get returned.
1439
- */
1440
- (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1441
-
1442
- yy_act = YY_STATE_EOF(YY_START);
1443
- goto do_action;
1444
- }
1445
-
1446
- else
1447
- {
1448
- if ( ! (yy_did_buffer_switch_on_eof) )
1449
- YY_NEW_FILE;
1450
- }
1451
- break;
1452
- }
1453
-
1454
- case EOB_ACT_CONTINUE_SCAN:
1455
- (yy_c_buf_p) =
1456
- (yytext_ptr) + yy_amount_of_matched_text;
1457
-
1458
- yy_current_state = yy_get_previous_state( );
1459
-
1460
- yy_cp = (yy_c_buf_p);
1461
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1462
- goto yy_match;
1463
-
1464
- case EOB_ACT_LAST_MATCH:
1465
- (yy_c_buf_p) =
1466
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1467
-
1468
- yy_current_state = yy_get_previous_state( );
1469
-
1470
- yy_cp = (yy_c_buf_p);
1471
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1472
- goto yy_find_action;
1473
- }
1474
- break;
1475
- }
1476
-
1477
- default:
1478
- YY_FATAL_ERROR(
1479
- "fatal flex scanner internal error--no action found" );
1480
- } /* end of action switch */
1481
- } /* end of scanning one token */
1482
- } /* end of yylex */
1483
-
1484
- /* yy_get_next_buffer - try to read in a new buffer
1485
- *
1486
- * Returns a code representing an action:
1487
- * EOB_ACT_LAST_MATCH -
1488
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1489
- * EOB_ACT_END_OF_FILE - end of file
1490
- */
1491
- static int yy_get_next_buffer (void)
1492
- {
1493
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1494
- register char *source = (yytext_ptr);
1495
- register int number_to_move, i;
1496
- int ret_val;
1497
-
1498
- if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1499
- YY_FATAL_ERROR(
1500
- "fatal flex scanner internal error--end of buffer missed" );
1501
-
1502
- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1503
- { /* Don't try to fill the buffer, so this is an EOF. */
1504
- if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1505
- {
1506
- /* We matched a single character, the EOB, so
1507
- * treat this as a final EOF.
1508
- */
1509
- return EOB_ACT_END_OF_FILE;
1510
- }
1511
-
1512
- else
1513
- {
1514
- /* We matched some text prior to the EOB, first
1515
- * process it.
1516
- */
1517
- return EOB_ACT_LAST_MATCH;
1518
- }
1519
- }
1520
-
1521
- /* Try to read more data. */
1522
-
1523
- /* First move last chars to start of buffer. */
1524
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1525
-
1526
- for ( i = 0; i < number_to_move; ++i )
1527
- *(dest++) = *(source++);
1528
-
1529
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1530
- /* don't do the read, it's not guaranteed to return an EOF,
1531
- * just force an EOF
1532
- */
1533
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1534
-
1535
- else
1536
- {
1537
- yy_size_t num_to_read =
1538
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1539
-
1540
- while ( num_to_read <= 0 )
1541
- { /* Not enough room in the buffer - grow it. */
1542
-
1543
- /* just a shorter name for the current buffer */
1544
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1545
-
1546
- int yy_c_buf_p_offset =
1547
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
1548
-
1549
- if ( b->yy_is_our_buffer )
1550
- {
1551
- yy_size_t new_size = b->yy_buf_size * 2;
1552
-
1553
- if ( new_size <= 0 )
1554
- b->yy_buf_size += b->yy_buf_size / 8;
1555
- else
1556
- b->yy_buf_size *= 2;
1557
-
1558
- b->yy_ch_buf = (char *)
1559
- /* Include room in for 2 EOB chars. */
1560
- yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1561
- }
1562
- else
1563
- /* Can't grow it, we don't own it. */
1564
- b->yy_ch_buf = 0;
1565
-
1566
- if ( ! b->yy_ch_buf )
1567
- YY_FATAL_ERROR(
1568
- "fatal error - scanner input buffer overflow" );
1569
-
1570
- (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1571
-
1572
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1573
- number_to_move - 1;
1574
-
1575
- }
1576
-
1577
- if ( num_to_read > YY_READ_BUF_SIZE )
1578
- num_to_read = YY_READ_BUF_SIZE;
1579
-
1580
- /* Read in more data. */
1581
- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1582
- (yy_n_chars), num_to_read );
1583
-
1584
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1585
- }
1586
-
1587
- if ( (yy_n_chars) == 0 )
1588
- {
1589
- if ( number_to_move == YY_MORE_ADJ )
1590
- {
1591
- ret_val = EOB_ACT_END_OF_FILE;
1592
- yyrestart(yyin );
1593
- }
1594
-
1595
- else
1596
- {
1597
- ret_val = EOB_ACT_LAST_MATCH;
1598
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1599
- YY_BUFFER_EOF_PENDING;
1600
- }
1601
- }
1602
-
1603
- else
1604
- ret_val = EOB_ACT_CONTINUE_SCAN;
1605
-
1606
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1607
- /* Extend the array by 50%, plus the number we really need. */
1608
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1609
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1610
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1611
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1612
- }
1613
-
1614
- (yy_n_chars) += number_to_move;
1615
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1616
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1617
-
1618
- (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1619
-
1620
- return ret_val;
1621
- }
1622
-
1623
- /* yy_get_previous_state - get the state just before the EOB char was reached */
1624
-
1625
- static yy_state_type yy_get_previous_state (void)
1626
- {
1627
- register yy_state_type yy_current_state;
1628
- register char *yy_cp;
1629
-
1630
- yy_current_state = (yy_start);
1631
-
1632
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1633
- {
1634
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1635
- if ( yy_accept[yy_current_state] )
1636
- {
1637
- (yy_last_accepting_state) = yy_current_state;
1638
- (yy_last_accepting_cpos) = yy_cp;
1639
- }
1640
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1641
- {
1642
- yy_current_state = (int) yy_def[yy_current_state];
1643
- if ( yy_current_state >= 186 )
1644
- yy_c = yy_meta[(unsigned int) yy_c];
1645
- }
1646
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1647
- }
1648
-
1649
- return yy_current_state;
1650
- }
1651
-
1652
- /* yy_try_NUL_trans - try to make a transition on the NUL character
1653
- *
1654
- * synopsis
1655
- * next_state = yy_try_NUL_trans( current_state );
1656
- */
1657
- static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1658
- {
1659
- register int yy_is_jam;
1660
- register char *yy_cp = (yy_c_buf_p);
1661
-
1662
- register YY_CHAR yy_c = 1;
1663
- if ( yy_accept[yy_current_state] )
1664
- {
1665
- (yy_last_accepting_state) = yy_current_state;
1666
- (yy_last_accepting_cpos) = yy_cp;
1667
- }
1668
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1669
- {
1670
- yy_current_state = (int) yy_def[yy_current_state];
1671
- if ( yy_current_state >= 186 )
1672
- yy_c = yy_meta[(unsigned int) yy_c];
1673
- }
1674
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1675
- yy_is_jam = (yy_current_state == 185);
1676
-
1677
- return yy_is_jam ? 0 : yy_current_state;
1678
- }
1679
-
1680
- static void yyunput (int c, register char * yy_bp )
1681
- {
1682
- register char *yy_cp;
1683
-
1684
- yy_cp = (yy_c_buf_p);
1685
-
1686
- /* undo effects of setting up yytext */
1687
- *yy_cp = (yy_hold_char);
1688
-
1689
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1690
- { /* need to shift things up to make room */
1691
- /* +2 for EOB chars. */
1692
- register yy_size_t number_to_move = (yy_n_chars) + 2;
1693
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1694
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1695
- register char *source =
1696
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1697
-
1698
- while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1699
- *--dest = *--source;
1700
-
1701
- yy_cp += (int) (dest - source);
1702
- yy_bp += (int) (dest - source);
1703
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1704
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1705
-
1706
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1707
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
1708
- }
1709
-
1710
- *--yy_cp = (char) c;
1711
-
1712
- if ( c == '\n' ){
1713
- --yylineno;
1714
- }
1715
-
1716
- (yytext_ptr) = yy_bp;
1717
- (yy_hold_char) = *yy_cp;
1718
- (yy_c_buf_p) = yy_cp;
1719
- }
1720
-
1721
- #ifndef YY_NO_INPUT
1722
- #ifdef __cplusplus
1723
- static int yyinput (void)
1724
- #else
1725
- static int input (void)
1726
- #endif
1727
-
1728
- {
1729
- int c;
1730
-
1731
- *(yy_c_buf_p) = (yy_hold_char);
1732
-
1733
- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1734
- {
1735
- /* yy_c_buf_p now points to the character we want to return.
1736
- * If this occurs *before* the EOB characters, then it's a
1737
- * valid NUL; if not, then we've hit the end of the buffer.
1738
- */
1739
- if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1740
- /* This was really a NUL. */
1741
- *(yy_c_buf_p) = '\0';
1742
-
1743
- else
1744
- { /* need more input */
1745
- yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1746
- ++(yy_c_buf_p);
1747
-
1748
- switch ( yy_get_next_buffer( ) )
1749
- {
1750
- case EOB_ACT_LAST_MATCH:
1751
- /* This happens because yy_g_n_b()
1752
- * sees that we've accumulated a
1753
- * token and flags that we need to
1754
- * try matching the token before
1755
- * proceeding. But for input(),
1756
- * there's no matching to consider.
1757
- * So convert the EOB_ACT_LAST_MATCH
1758
- * to EOB_ACT_END_OF_FILE.
1759
- */
1760
-
1761
- /* Reset buffer status. */
1762
- yyrestart(yyin );
1763
-
1764
- /*FALLTHROUGH*/
1765
-
1766
- case EOB_ACT_END_OF_FILE:
1767
- {
1768
- if ( yywrap( ) )
1769
- return 0;
1770
-
1771
- if ( ! (yy_did_buffer_switch_on_eof) )
1772
- YY_NEW_FILE;
1773
- #ifdef __cplusplus
1774
- return yyinput();
1775
- #else
1776
- return input();
1777
- #endif
1778
- }
1779
-
1780
- case EOB_ACT_CONTINUE_SCAN:
1781
- (yy_c_buf_p) = (yytext_ptr) + offset;
1782
- break;
1783
- }
1784
- }
1785
- }
1786
-
1787
- c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1788
- *(yy_c_buf_p) = '\0'; /* preserve yytext */
1789
- (yy_hold_char) = *++(yy_c_buf_p);
1790
-
1791
- if ( c == '\n' )
1792
-
1793
- yylineno++;
1794
- ;
1795
-
1796
- return c;
1797
- }
1798
- #endif /* ifndef YY_NO_INPUT */
1799
-
1800
- /** Immediately switch to a different input stream.
1801
- * @param input_file A readable stream.
1802
- *
1803
- * @note This function does not reset the start condition to @c INITIAL .
1804
- */
1805
- void yyrestart (FILE * input_file )
1806
- {
1807
-
1808
- if ( ! YY_CURRENT_BUFFER ){
1809
- yyensure_buffer_stack ();
1810
- YY_CURRENT_BUFFER_LVALUE =
1811
- yy_create_buffer(yyin,YY_BUF_SIZE );
1812
- }
1813
-
1814
- yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1815
- yy_load_buffer_state( );
1816
- }
1817
-
1818
- /** Switch to a different input buffer.
1819
- * @param new_buffer The new input buffer.
1820
- *
1821
- */
1822
- void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1823
- {
1824
-
1825
- /* TODO. We should be able to replace this entire function body
1826
- * with
1827
- * yypop_buffer_state();
1828
- * yypush_buffer_state(new_buffer);
1829
- */
1830
- yyensure_buffer_stack ();
1831
- if ( YY_CURRENT_BUFFER == new_buffer )
1832
- return;
1833
-
1834
- if ( YY_CURRENT_BUFFER )
1835
- {
1836
- /* Flush out information for old buffer. */
1837
- *(yy_c_buf_p) = (yy_hold_char);
1838
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1839
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1840
- }
1841
-
1842
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
1843
- yy_load_buffer_state( );
1844
-
1845
- /* We don't actually know whether we did this switch during
1846
- * EOF (yywrap()) processing, but the only time this flag
1847
- * is looked at is after yywrap() is called, so it's safe
1848
- * to go ahead and always set it.
1849
- */
1850
- (yy_did_buffer_switch_on_eof) = 1;
1851
- }
1852
-
1853
- static void yy_load_buffer_state (void)
1854
- {
1855
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1856
- (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1857
- yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1858
- (yy_hold_char) = *(yy_c_buf_p);
1859
- }
1860
-
1861
- /** Allocate and initialize an input buffer state.
1862
- * @param file A readable stream.
1863
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1864
- *
1865
- * @return the allocated buffer state.
1866
- */
1867
- YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1868
- {
1869
- YY_BUFFER_STATE b;
1870
-
1871
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1872
- if ( ! b )
1873
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1874
-
1875
- b->yy_buf_size = size;
1876
-
1877
- /* yy_ch_buf has to be 2 characters longer than the size given because
1878
- * we need to put in 2 end-of-buffer characters.
1879
- */
1880
- b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1881
- if ( ! b->yy_ch_buf )
1882
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1883
-
1884
- b->yy_is_our_buffer = 1;
1885
-
1886
- yy_init_buffer(b,file );
1887
-
1888
- return b;
1889
- }
1890
-
1891
- /** Destroy the buffer.
1892
- * @param b a buffer created with yy_create_buffer()
1893
- *
1894
- */
1895
- void yy_delete_buffer (YY_BUFFER_STATE b )
1896
- {
1897
-
1898
- if ( ! b )
1899
- return;
1900
-
1901
- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1902
- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1903
-
1904
- if ( b->yy_is_our_buffer )
1905
- yyfree((void *) b->yy_ch_buf );
1906
-
1907
- yyfree((void *) b );
1908
- }
1909
-
1910
- #ifndef __cplusplus
1911
- extern int isatty (int );
1912
- #endif /* __cplusplus */
1913
-
1914
- /* Initializes or reinitializes a buffer.
1915
- * This function is sometimes called more than once on the same buffer,
1916
- * such as during a yyrestart() or at EOF.
1917
- */
1918
- static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1919
-
1920
- {
1921
- int oerrno = errno;
1922
-
1923
- yy_flush_buffer(b );
1924
-
1925
- b->yy_input_file = file;
1926
- b->yy_fill_buffer = 1;
1927
-
1928
- /* If b is the current buffer, then yy_init_buffer was _probably_
1929
- * called from yyrestart() or through yy_get_next_buffer.
1930
- * In that case, we don't want to reset the lineno or column.
1931
- */
1932
- if (b != YY_CURRENT_BUFFER){
1933
- b->yy_bs_lineno = 1;
1934
- b->yy_bs_column = 0;
1935
- }
1936
-
1937
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1938
-
1939
- errno = oerrno;
1940
- }
1941
-
1942
- /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1943
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1944
- *
1945
- */
1946
- void yy_flush_buffer (YY_BUFFER_STATE b )
1947
- {
1948
- if ( ! b )
1949
- return;
1950
-
1951
- b->yy_n_chars = 0;
1952
-
1953
- /* We always need two end-of-buffer characters. The first causes
1954
- * a transition to the end-of-buffer state. The second causes
1955
- * a jam in that state.
1956
- */
1957
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1958
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1959
-
1960
- b->yy_buf_pos = &b->yy_ch_buf[0];
1961
-
1962
- b->yy_at_bol = 1;
1963
- b->yy_buffer_status = YY_BUFFER_NEW;
1964
-
1965
- if ( b == YY_CURRENT_BUFFER )
1966
- yy_load_buffer_state( );
1967
- }
1968
-
1969
- /** Pushes the new state onto the stack. The new state becomes
1970
- * the current state. This function will allocate the stack
1971
- * if necessary.
1972
- * @param new_buffer The new state.
1973
- *
1974
- */
1975
- void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1976
- {
1977
- if (new_buffer == NULL)
1978
- return;
1979
-
1980
- yyensure_buffer_stack();
1981
-
1982
- /* This block is copied from yy_switch_to_buffer. */
1983
- if ( YY_CURRENT_BUFFER )
1984
- {
1985
- /* Flush out information for old buffer. */
1986
- *(yy_c_buf_p) = (yy_hold_char);
1987
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1988
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1989
- }
1990
-
1991
- /* Only push if top exists. Otherwise, replace top. */
1992
- if (YY_CURRENT_BUFFER)
1993
- (yy_buffer_stack_top)++;
1994
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
1995
-
1996
- /* copied from yy_switch_to_buffer. */
1997
- yy_load_buffer_state( );
1998
- (yy_did_buffer_switch_on_eof) = 1;
1999
- }
2000
-
2001
- /** Removes and deletes the top of the stack, if present.
2002
- * The next element becomes the new top.
2003
- *
2004
- */
2005
- void yypop_buffer_state (void)
2006
- {
2007
- if (!YY_CURRENT_BUFFER)
2008
- return;
2009
-
2010
- yy_delete_buffer(YY_CURRENT_BUFFER );
2011
- YY_CURRENT_BUFFER_LVALUE = NULL;
2012
- if ((yy_buffer_stack_top) > 0)
2013
- --(yy_buffer_stack_top);
2014
-
2015
- if (YY_CURRENT_BUFFER) {
2016
- yy_load_buffer_state( );
2017
- (yy_did_buffer_switch_on_eof) = 1;
2018
- }
2019
- }
2020
-
2021
- /* Allocates the stack if it does not exist.
2022
- * Guarantees space for at least one push.
2023
- */
2024
- static void yyensure_buffer_stack (void)
2025
- {
2026
- yy_size_t num_to_alloc;
2027
-
2028
- if (!(yy_buffer_stack)) {
2029
-
2030
- /* First allocation is just for 2 elements, since we don't know if this
2031
- * scanner will even need a stack. We use 2 instead of 1 to avoid an
2032
- * immediate realloc on the next call.
2033
- */
2034
- num_to_alloc = 1;
2035
- (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2036
- (num_to_alloc * sizeof(struct yy_buffer_state*)
2037
- );
2038
- if ( ! (yy_buffer_stack) )
2039
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2040
-
2041
- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2042
-
2043
- (yy_buffer_stack_max) = num_to_alloc;
2044
- (yy_buffer_stack_top) = 0;
2045
- return;
2046
- }
2047
-
2048
- if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2049
-
2050
- /* Increase the buffer to prepare for a possible push. */
2051
- int grow_size = 8 /* arbitrary grow size */;
2052
-
2053
- num_to_alloc = (yy_buffer_stack_max) + grow_size;
2054
- (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2055
- ((yy_buffer_stack),
2056
- num_to_alloc * sizeof(struct yy_buffer_state*)
2057
- );
2058
- if ( ! (yy_buffer_stack) )
2059
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2060
-
2061
- /* zero only the new slots.*/
2062
- memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2063
- (yy_buffer_stack_max) = num_to_alloc;
2064
- }
2065
- }
2066
-
2067
- /** Setup the input buffer state to scan directly from a user-specified character buffer.
2068
- * @param base the character buffer
2069
- * @param size the size in bytes of the character buffer
2070
- *
2071
- * @return the newly allocated buffer state object.
2072
- */
2073
- YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2074
- {
2075
- YY_BUFFER_STATE b;
2076
-
2077
- if ( size < 2 ||
2078
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
2079
- base[size-1] != YY_END_OF_BUFFER_CHAR )
2080
- /* They forgot to leave room for the EOB's. */
2081
- return 0;
2082
-
2083
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2084
- if ( ! b )
2085
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2086
-
2087
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2088
- b->yy_buf_pos = b->yy_ch_buf = base;
2089
- b->yy_is_our_buffer = 0;
2090
- b->yy_input_file = 0;
2091
- b->yy_n_chars = b->yy_buf_size;
2092
- b->yy_is_interactive = 0;
2093
- b->yy_at_bol = 1;
2094
- b->yy_fill_buffer = 0;
2095
- b->yy_buffer_status = YY_BUFFER_NEW;
2096
-
2097
- yy_switch_to_buffer(b );
2098
-
2099
- return b;
2100
- }
2101
-
2102
- /** Setup the input buffer state to scan a string. The next call to yylex() will
2103
- * scan from a @e copy of @a str.
2104
- * @param yystr a NUL-terminated string to scan
2105
- *
2106
- * @return the newly allocated buffer state object.
2107
- * @note If you want to scan bytes that may contain NUL values, then use
2108
- * yy_scan_bytes() instead.
2109
- */
2110
- YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2111
- {
2112
-
2113
- return yy_scan_bytes(yystr,strlen(yystr) );
2114
- }
2115
-
2116
- /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2117
- * scan from a @e copy of @a bytes.
2118
- * @param bytes the byte buffer to scan
2119
- * @param len the number of bytes in the buffer pointed to by @a bytes.
2120
- *
2121
- * @return the newly allocated buffer state object.
2122
- */
2123
- YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
2124
- {
2125
- YY_BUFFER_STATE b;
2126
- char *buf;
2127
- yy_size_t n, i;
2128
-
2129
- /* Get memory for full buffer, including space for trailing EOB's. */
2130
- n = _yybytes_len + 2;
2131
- buf = (char *) yyalloc(n );
2132
- if ( ! buf )
2133
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2134
-
2135
- for ( i = 0; i < _yybytes_len; ++i )
2136
- buf[i] = yybytes[i];
2137
-
2138
- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2139
-
2140
- b = yy_scan_buffer(buf,n );
2141
- if ( ! b )
2142
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2143
-
2144
- /* It's okay to grow etc. this buffer, and we should throw it
2145
- * away when we're done.
2146
- */
2147
- b->yy_is_our_buffer = 1;
2148
-
2149
- return b;
2150
- }
2151
-
2152
- #ifndef YY_EXIT_FAILURE
2153
- #define YY_EXIT_FAILURE 2
2154
- #endif
2155
-
2156
- static void yy_fatal_error (yyconst char* msg )
2157
- {
2158
- (void) fprintf( stderr, "%s\n", msg );
2159
- exit( YY_EXIT_FAILURE );
2160
- }
2161
-
2162
- /* Redefine yyless() so it works in section 3 code. */
2163
-
2164
- #undef yyless
2165
- #define yyless(n) \
2166
- do \
2167
- { \
2168
- /* Undo effects of setting up yytext. */ \
2169
- int yyless_macro_arg = (n); \
2170
- YY_LESS_LINENO(yyless_macro_arg);\
2171
- yytext[yyleng] = (yy_hold_char); \
2172
- (yy_c_buf_p) = yytext + yyless_macro_arg; \
2173
- (yy_hold_char) = *(yy_c_buf_p); \
2174
- *(yy_c_buf_p) = '\0'; \
2175
- yyleng = yyless_macro_arg; \
2176
- } \
2177
- while ( 0 )
2178
-
2179
- /* Accessor methods (get/set functions) to struct members. */
2180
-
2181
- /** Get the current line number.
2182
- *
2183
- */
2184
- int yyget_lineno (void)
2185
- {
2186
-
2187
- return yylineno;
2188
- }
2189
-
2190
- /** Get the input stream.
2191
- *
2192
- */
2193
- FILE *yyget_in (void)
2194
- {
2195
- return yyin;
2196
- }
2197
-
2198
- /** Get the output stream.
2199
- *
2200
- */
2201
- FILE *yyget_out (void)
2202
- {
2203
- return yyout;
2204
- }
2205
-
2206
- /** Get the length of the current token.
2207
- *
2208
- */
2209
- yy_size_t yyget_leng (void)
2210
- {
2211
- return yyleng;
2212
- }
2213
-
2214
- /** Get the current token.
2215
- *
2216
- */
2217
-
2218
- char *yyget_text (void)
2219
- {
2220
- return yytext;
2221
- }
2222
-
2223
- /** Set the current line number.
2224
- * @param line_number
2225
- *
2226
- */
2227
- void yyset_lineno (int line_number )
2228
- {
2229
-
2230
- yylineno = line_number;
2231
- }
2232
-
2233
- /** Set the input stream. This does not discard the current
2234
- * input buffer.
2235
- * @param in_str A readable stream.
2236
- *
2237
- * @see yy_switch_to_buffer
2238
- */
2239
- void yyset_in (FILE * in_str )
2240
- {
2241
- yyin = in_str ;
2242
- }
2243
-
2244
- void yyset_out (FILE * out_str )
2245
- {
2246
- yyout = out_str ;
2247
- }
2248
-
2249
- int yyget_debug (void)
2250
- {
2251
- return yy_flex_debug;
2252
- }
2253
-
2254
- void yyset_debug (int bdebug )
2255
- {
2256
- yy_flex_debug = bdebug ;
2257
- }
2258
-
2259
- static int yy_init_globals (void)
2260
- {
2261
- /* Initialization is the same as for the non-reentrant scanner.
2262
- * This function is called from yylex_destroy(), so don't allocate here.
2263
- */
2264
-
2265
- /* We do not touch yylineno unless the option is enabled. */
2266
- yylineno = 1;
2267
-
2268
- (yy_buffer_stack) = 0;
2269
- (yy_buffer_stack_top) = 0;
2270
- (yy_buffer_stack_max) = 0;
2271
- (yy_c_buf_p) = (char *) 0;
2272
- (yy_init) = 0;
2273
- (yy_start) = 0;
2274
-
2275
- /* Defined in main.c */
2276
- #ifdef YY_STDINIT
2277
- yyin = stdin;
2278
- yyout = stdout;
2279
- #else
2280
- yyin = (FILE *) 0;
2281
- yyout = (FILE *) 0;
2282
- #endif
2283
-
2284
- /* For future reference: Set errno on error, since we are called by
2285
- * yylex_init()
2286
- */
2287
- return 0;
2288
- }
2289
-
2290
- /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2291
- int yylex_destroy (void)
2292
- {
2293
-
2294
- /* Pop the buffer stack, destroying each element. */
2295
- while(YY_CURRENT_BUFFER){
2296
- yy_delete_buffer(YY_CURRENT_BUFFER );
2297
- YY_CURRENT_BUFFER_LVALUE = NULL;
2298
- yypop_buffer_state();
2299
- }
2300
-
2301
- /* Destroy the stack itself. */
2302
- yyfree((yy_buffer_stack) );
2303
- (yy_buffer_stack) = NULL;
2304
-
2305
- /* Reset the globals. This is important in a non-reentrant scanner so the next time
2306
- * yylex() is called, initialization will occur. */
2307
- yy_init_globals( );
2308
-
2309
- return 0;
2310
- }
2311
-
2312
- /*
2313
- * Internal utility routines.
2314
- */
2315
-
2316
- #ifndef yytext_ptr
2317
- static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2318
- {
2319
- register int i;
2320
- for ( i = 0; i < n; ++i )
2321
- s1[i] = s2[i];
2322
- }
2323
- #endif
2324
-
2325
- #ifdef YY_NEED_STRLEN
2326
- static int yy_flex_strlen (yyconst char * s )
2327
- {
2328
- register int n;
2329
- for ( n = 0; s[n]; ++n )
2330
- ;
2331
-
2332
- return n;
2333
- }
2334
- #endif
2335
-
2336
- void *yyalloc (yy_size_t size )
2337
- {
2338
- return (void *) malloc( size );
2339
- }
2340
-
2341
- void *yyrealloc (void * ptr, yy_size_t size )
2342
- {
2343
- /* The cast to (char *) in the following accommodates both
2344
- * implementations that use char* generic pointers, and those
2345
- * that use void* generic pointers. It works with the latter
2346
- * because both ANSI C and C++ allow castless assignment from
2347
- * any pointer type to void*, and deal with argument conversions
2348
- * as though doing an assignment.
2349
- */
2350
- return (void *) realloc( (char *) ptr, size );
2351
- }
2352
-
2353
- void yyfree (void * ptr )
2354
- {
2355
- free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2356
- }
2357
-
2358
- #define YYTABLES_NAME "yytables"
2359
-
2360
- #line 192 "/Users/backtype/projects/fancy/lib/parser/ext/lexer.lex"