This file is ruby syntax file for GNU Source-highlight.
* Install
% zcat source-highlight_for_ruby-20030210.diff.gz | patch -p1
or
% patch -p1 < source-highlight_for_ruby-20030210.diff
% ./configure
% make
# make install
* Execution
Specify 'ruby' as --src-lang(or -s), when executing.
% source-highlight -s ruby -i foo.rb -o foo.html
diff -cr source-highlight-1.6.3.org/doc/cmdline.c.html source-highlight-1.6.3/doc/cmdline.c.html
*** source-highlight-1.6.3.org/doc/cmdline.c.html Sun Jan 26 01:38:21 2003
--- source-highlight-1.6.3/doc/cmdline.c.html Sun Feb 9 22:28:55 2003
***************
*** 4,10 ****
!
--- 4,10 ----
!
***************
*** 79,85 ****
printf(" -V --version Print version and exit\n");
printf(" -iSTRING --input=STRING input file. default std input\n");
printf(" -oSTRING --output=STRING output file. default std output\n");
! printf(" -sSTRING --src-lang=STRING source language (e.g. java, cpp, prolog, perl, php3, python, flex, changelog)\n");
printf(" -fSTRING --out-format=STRING output format (e.g. html, xhtml)\n");
printf(" -v --verbose verbose mode on\n");
printf(" -d --doc create html with title and header\n");
--- 79,85 ----
printf(" -V --version Print version and exit\n");
printf(" -iSTRING --input=STRING input file. default std input\n");
printf(" -oSTRING --output=STRING output file. default std output\n");
! printf(" -sSTRING --src-lang=STRING source language (e.g. java, cpp, prolog, perl, php3, python, ruby, flex, changelog)\n");
printf(" -fSTRING --out-format=STRING output format (e.g. html, xhtml)\n");
printf(" -v --verbose verbose mode on\n");
printf(" -d --doc create html with title and header\n");
***************
*** 224,230 ****
args_info->output_arg = strdup (optarg);
break;
! case 's':
if (args_info->src_lang_given)
{
fprintf (stderr, "%s: `--src-lang' (`-s') option given more than once\n", PACKAGE);
--- 224,230 ----
args_info->output_arg = strdup (optarg);
break;
! case 's':
if (args_info->src_lang_given)
{
fprintf (stderr, "%s: `--src-lang' (`-s') option given more than once\n", PACKAGE);
diff -cr source-highlight-1.6.3.org/doc/cmdline.h.html source-highlight-1.6.3/doc/cmdline.h.html
*** source-highlight-1.6.3.org/doc/cmdline.h.html Sun Jan 26 01:38:21 2003
--- source-highlight-1.6.3/doc/cmdline.h.html Sun Feb 9 22:28:55 2003
***************
*** 4,10 ****
!
--- 4,10 ----
!
***************
*** 38,44 ****
{
char * input_arg;
char * output_arg;
! char * src_lang_arg;
char * out_format_arg;
char * css_arg;
char * title_arg;
--- 38,44 ----
{
char * input_arg;
char * output_arg;
! char * src_lang_arg;
char * out_format_arg;
char * css_arg;
char * title_arg;
diff -cr source-highlight-1.6.3.org/src/Makefile.am source-highlight-1.6.3/src/Makefile.am
*** source-highlight-1.6.3.org/src/Makefile.am Sun Jan 26 01:39:34 2003
--- source-highlight-1.6.3/src/Makefile.am Sun Feb 9 22:24:27 2003
***************
*** 36,41 ****
--- 36,42 ----
perl_scanner.ll \
php3_scanner.ll \
python_scanner.ll \
+ ruby_scanner.ll \
flex_scanner.ll \
changelog_scanner.ll \
cxxconfig.h \
***************
*** 54,59 ****
--- 55,61 ----
php3_scanner.cc \
prolog_scanner.cc \
python_scanner.cc \
+ ruby_scanner.cc \
flex_scanner.cc \
changelog_scanner.cc
***************
*** 78,83 ****
--- 80,86 ----
perl_scanner.cc \
php3_scanner.cc \
python_scanner.cc \
+ ruby_scanner.cc \
flex_scanner.cc \
changelog_scanner.cc
***************
*** 95,100 ****
--- 98,105 ----
php3_scanner.cc: $(srcdir)/php3_scanner.ll
$(LEX) $(LFLAGS) -o $@ $<
python_scanner.cc: $(srcdir)/python_scanner.ll
+ $(LEX) $(LFLAGS) -o $@ $<
+ ruby_scanner.cc: $(srcdir)/ruby_scanner.ll
$(LEX) $(LFLAGS) -o $@ $<
flex_scanner.cc: $(srcdir)/flex_scanner.ll
$(LEX) $(LFLAGS) -o $@ $<
diff -cr source-highlight-1.6.3.org/src/Makefile.in source-highlight-1.6.3/src/Makefile.in
*** source-highlight-1.6.3.org/src/Makefile.in Fri Jan 31 01:55:47 2003
--- source-highlight-1.6.3/src/Makefile.in Sun Feb 9 22:26:08 2003
***************
*** 171,176 ****
--- 171,177 ----
perl_scanner.ll \
php3_scanner.ll \
python_scanner.ll \
+ ruby_scanner.ll \
flex_scanner.ll \
changelog_scanner.ll \
cxxconfig.h \
***************
*** 187,192 ****
--- 188,194 ----
php3_scanner.cc \
prolog_scanner.cc \
python_scanner.cc \
+ ruby_scanner.cc \
flex_scanner.cc \
changelog_scanner.cc
***************
*** 213,218 ****
--- 215,221 ----
perl_scanner.cc \
php3_scanner.cc \
python_scanner.cc \
+ ruby_scanner.cc \
flex_scanner.cc \
changelog_scanner.cc
***************
*** 226,232 ****
am_source_highlight_OBJECTS = cpp_scanner.$(OBJEXT) \
java_scanner.$(OBJEXT) prolog_scanner.$(OBJEXT) \
perl_scanner.$(OBJEXT) php3_scanner.$(OBJEXT) \
! python_scanner.$(OBJEXT) flex_scanner.$(OBJEXT) \
changelog_scanner.$(OBJEXT) source-highlight.$(OBJEXT)
source_highlight_OBJECTS = $(am_source_highlight_OBJECTS)
source_highlight_DEPENDENCIES = startapp.o @LIBOBJS@ \
--- 229,235 ----
am_source_highlight_OBJECTS = cpp_scanner.$(OBJEXT) \
java_scanner.$(OBJEXT) prolog_scanner.$(OBJEXT) \
perl_scanner.$(OBJEXT) php3_scanner.$(OBJEXT) \
! python_scanner.$(OBJEXT) ruby_scanner.$(OBJEXT) flex_scanner.$(OBJEXT) \
changelog_scanner.$(OBJEXT) source-highlight.$(OBJEXT)
source_highlight_OBJECTS = $(am_source_highlight_OBJECTS)
source_highlight_DEPENDENCIES = startapp.o @LIBOBJS@ \
***************
*** 234,240 ****
source_highlight_LDFLAGS =
am__objects_1 = cpp_scanner.$(OBJEXT) java_scanner.$(OBJEXT) \
prolog_scanner.$(OBJEXT) perl_scanner.$(OBJEXT) \
! php3_scanner.$(OBJEXT) python_scanner.$(OBJEXT) \
flex_scanner.$(OBJEXT) changelog_scanner.$(OBJEXT) \
source-highlight.$(OBJEXT)
am_source_highlight_cgi_OBJECTS = $(am__objects_1)
--- 237,243 ----
source_highlight_LDFLAGS =
am__objects_1 = cpp_scanner.$(OBJEXT) java_scanner.$(OBJEXT) \
prolog_scanner.$(OBJEXT) perl_scanner.$(OBJEXT) \
! php3_scanner.$(OBJEXT) python_scanner.$(OBJEXT) ruby_scanner.$(OBJEXT) \
flex_scanner.$(OBJEXT) changelog_scanner.$(OBJEXT) \
source-highlight.$(OBJEXT)
am_source_highlight_cgi_OBJECTS = $(am__objects_1)
***************
*** 258,263 ****
--- 261,267 ----
@AMDEP_TRUE@ ./$(DEPDIR)/php3_scanner.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/prolog_scanner.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/python_scanner.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/ruby_scanner.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/source-highlight.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
***************
*** 283,289 ****
DIST_COMMON = Makefile.am Makefile.in changelog_scanner.cc cpp2html.in \
cpp_scanner.cc flex_scanner.cc getopt.c getopt1.c java2html.in \
java_scanner.cc perl_scanner.cc php3_scanner.cc \
! prolog_scanner.cc python_scanner.cc ylwrap yywrap.c
SOURCES = $(source_highlight_SOURCES) $(source_highlight_cgi_SOURCES)
all: $(BUILT_SOURCES)
--- 287,293 ----
DIST_COMMON = Makefile.am Makefile.in changelog_scanner.cc cpp2html.in \
cpp_scanner.cc flex_scanner.cc getopt.c getopt1.c java2html.in \
java_scanner.cc perl_scanner.cc php3_scanner.cc \
! prolog_scanner.cc python_scanner.cc ruby_scanner.cc ylwrap yywrap.c
SOURCES = $(source_highlight_SOURCES) $(source_highlight_cgi_SOURCES)
all: $(BUILT_SOURCES)
***************
*** 368,373 ****
--- 372,378 ----
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/php3_scanner.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prolog_scanner.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/python_scanner.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ruby_scanner.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/source-highlight.Po@am__quote@
distclean-depend:
***************
*** 633,638 ****
--- 638,644 ----
@echo "it deletes files that may require special tools to rebuild."
-rm -f java_scanner.cc
-rm -f python_scanner.cc
+ -rm -f ruby_scanner.cc
-rm -f prolog_scanner.cc
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-rm -f php3_scanner.cc
***************
*** 725,730 ****
--- 731,738 ----
php3_scanner.cc: $(srcdir)/php3_scanner.ll
$(LEX) $(LFLAGS) -o $@ $<
python_scanner.cc: $(srcdir)/python_scanner.ll
+ $(LEX) $(LFLAGS) -o $@ $<
+ ruby_scanner.cc: $(srcdir)/ruby_scanner.ll
$(LEX) $(LFLAGS) -o $@ $<
flex_scanner.cc: $(srcdir)/flex_scanner.ll
$(LEX) $(LFLAGS) -o $@ $<
diff -cr source-highlight-1.6.3.org/src/lib/cmdline.c source-highlight-1.6.3/src/lib/cmdline.c
*** source-highlight-1.6.3.org/src/lib/cmdline.c Mon Oct 14 05:09:43 2002
--- source-highlight-1.6.3/src/lib/cmdline.c Sun Feb 9 22:26:16 2003
***************
*** 50,56 ****
printf(" -V --version Print version and exit\n");
printf(" -iSTRING --input=STRING input file. default std input\n");
printf(" -oSTRING --output=STRING output file. default std output\n");
! printf(" -sSTRING --src-lang=STRING source language (e.g. java, cpp, prolog, perl, php3, python, flex, changelog)\n");
printf(" -fSTRING --out-format=STRING output format (e.g. html, xhtml)\n");
printf(" -v --verbose verbose mode on\n");
printf(" -d --doc create html with title and header\n");
--- 50,56 ----
printf(" -V --version Print version and exit\n");
printf(" -iSTRING --input=STRING input file. default std input\n");
printf(" -oSTRING --output=STRING output file. default std output\n");
! printf(" -sSTRING --src-lang=STRING source language (e.g. java, cpp, prolog, perl, php3, python, ruby, flex, changelog)\n");
printf(" -fSTRING --out-format=STRING output format (e.g. html, xhtml)\n");
printf(" -v --verbose verbose mode on\n");
printf(" -d --doc create html with title and header\n");
***************
*** 195,201 ****
args_info->output_arg = strdup (optarg);
break;
! case 's': /* source language (e.g. java, cpp, prolog, perl, php3, python, flex, changelog). */
if (args_info->src_lang_given)
{
fprintf (stderr, "%s: `--src-lang' (`-s') option given more than once\n", PACKAGE);
--- 195,201 ----
args_info->output_arg = strdup (optarg);
break;
! case 's': /* source language (e.g. java, cpp, prolog, perl, php3, python, ruby, flex, changelog). */
if (args_info->src_lang_given)
{
fprintf (stderr, "%s: `--src-lang' (`-s') option given more than once\n", PACKAGE);
diff -cr source-highlight-1.6.3.org/src/lib/cmdline.ggo source-highlight-1.6.3/src/lib/cmdline.ggo
*** source-highlight-1.6.3.org/src/lib/cmdline.ggo Mon Oct 14 05:09:43 2002
--- source-highlight-1.6.3/src/lib/cmdline.ggo Sun Feb 9 22:20:54 2003
***************
*** 38,44 ****
# Options
option "input" i "input file. default std input" string no
option "output" o "output file. default std output" string no
! option "src-lang" s "source language (e.g. java, cpp, prolog, perl, php3, python, flex, changelog)" string yes
option "out-format" f "output format (e.g. html, xhtml)" string yes
option "verbose" v "verbose mode on" no
option "doc" d "create html with title and header" no
--- 38,44 ----
# Options
option "input" i "input file. default std input" string no
option "output" o "output file. default std output" string no
! option "src-lang" s "source language (e.g. java, cpp, prolog, perl, php3, python, ruby, flex, changelog)" string yes
option "out-format" f "output format (e.g. html, xhtml)" string yes
option "verbose" v "verbose mode on" no
option "doc" d "create html with title and header" no
diff -cr source-highlight-1.6.3.org/src/lib/cmdline.h source-highlight-1.6.3/src/lib/cmdline.h
*** source-highlight-1.6.3.org/src/lib/cmdline.h Mon Oct 14 05:09:43 2002
--- source-highlight-1.6.3/src/lib/cmdline.h Sun Feb 9 22:20:23 2003
***************
*** 22,28 ****
{
char * input_arg; /* input file. default std input. */
char * output_arg; /* output file. default std output. */
! char * src_lang_arg; /* source language (e.g. java, cpp, prolog, perl, php3, python, flex, changelog). */
char * out_format_arg; /* output format (e.g. html, xhtml). */
char * css_arg; /* use a css for formatting. Implies --doc. */
char * title_arg; /* give a title to the html. Implies --doc. */
--- 22,28 ----
{
char * input_arg; /* input file. default std input. */
char * output_arg; /* output file. default std output. */
! char * src_lang_arg; /* source language (e.g. java, cpp, prolog, perl, php3, python, ruby, flex, changelog). */
char * out_format_arg; /* output format (e.g. html, xhtml). */
char * css_arg; /* use a css for formatting. Implies --doc. */
char * title_arg; /* give a title to the html. Implies --doc. */
diff -cr source-highlight-1.6.3.org/src/lib/genfun.cc source-highlight-1.6.3/src/lib/genfun.cc
*** source-highlight-1.6.3.org/src/lib/genfun.cc Thu Jan 2 01:24:39 2003
--- source-highlight-1.6.3/src/lib/genfun.cc Sun Feb 9 22:21:24 2003
***************
*** 53,58 ****
--- 53,59 ----
extern int perl_scanner_lex() ;
extern int php3_scanner_lex() ;
extern int python_scanner_lex() ;
+ extern int ruby_scanner_lex() ;
extern int flex_scanner_lex() ;
extern int changelog_scanner_lex() ;
***************
*** 155,160 ****
--- 156,163 ----
php3_scanner_lex ();
else if (strcmp (source_language, "python") == 0)
python_scanner_lex ();
+ else if (strcmp (source_language, "ruby") == 0)
+ ruby_scanner_lex ();
else if (strcmp (source_language, "flex") == 0)
flex_scanner_lex ();
else if (strcmp (source_language, "changelog") == 0)
diff -crN source-highlight-1.6.3.org/src/ruby_scanner.cc source-highlight-1.6.3/src/ruby_scanner.cc
*** source-highlight-1.6.3.org/src/ruby_scanner.cc Thu Jan 1 09:00:00 1970
--- source-highlight-1.6.3/src/ruby_scanner.cc Mon Feb 10 00:51:11 2003
***************
*** 0 ****
--- 1,2179 ----
+ #define yy_create_buffer ruby_scanner__create_buffer
+ #define yy_delete_buffer ruby_scanner__delete_buffer
+ #define yy_scan_buffer ruby_scanner__scan_buffer
+ #define yy_scan_string ruby_scanner__scan_string
+ #define yy_scan_bytes ruby_scanner__scan_bytes
+ #define yy_flex_debug ruby_scanner__flex_debug
+ #define yy_init_buffer ruby_scanner__init_buffer
+ #define yy_flush_buffer ruby_scanner__flush_buffer
+ #define yy_load_buffer_state ruby_scanner__load_buffer_state
+ #define yy_switch_to_buffer ruby_scanner__switch_to_buffer
+ #define yyin ruby_scanner_in
+ #define yyleng ruby_scanner_leng
+ #define yylex ruby_scanner_lex
+ #define yyout ruby_scanner_out
+ #define yyrestart ruby_scanner_restart
+ #define yytext ruby_scanner_text
+ #define yylineno ruby_scanner_lineno
+
+ #line 20 "ruby_scanner.cc"
+ /* A lexical scanner generated by flex */
+
+ /* Scanner skeleton version:
+ * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
+ */
+
+ #define FLEX_SCANNER
+ #define YY_FLEX_MAJOR_VERSION 2
+ #define YY_FLEX_MINOR_VERSION 5
+
+ #include
+
+
+ /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+ #ifdef c_plusplus
+ #ifndef __cplusplus
+ #define __cplusplus
+ #endif
+ #endif
+
+
+ #ifdef __cplusplus
+
+ #include
+ #include
+
+ /* Use prototypes in function declarations. */
+ #define YY_USE_PROTOS
+
+ /* The "const" storage-class-modifier is valid. */
+ #define YY_USE_CONST
+
+ #else /* ! __cplusplus */
+
+ #if __STDC__
+
+ #define YY_USE_PROTOS
+ #define YY_USE_CONST
+
+ #endif /* __STDC__ */
+ #endif /* ! __cplusplus */
+
+ #ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+ #include
+ #include
+ #define YY_USE_CONST
+ #define YY_USE_PROTOS
+ #endif
+
+ #ifdef YY_USE_CONST
+ #define yyconst const
+ #else
+ #define yyconst
+ #endif
+
+
+ #ifdef YY_USE_PROTOS
+ #define YY_PROTO(proto) proto
+ #else
+ #define YY_PROTO(proto) ()
+ #endif
+
+ /* Returned upon end-of-file. */
+ #define YY_NULL 0
+
+ /* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+ /* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+ #define BEGIN yy_start = 1 + 2 *
+
+ /* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+ #define YY_START ((yy_start - 1) / 2)
+ #define YYSTATE YY_START
+
+ /* Action number for EOF rule of a given start state. */
+ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+ /* Special action meaning "start processing a new file". */
+ #define YY_NEW_FILE yyrestart( yyin )
+
+ #define YY_END_OF_BUFFER_CHAR 0
+
+ /* Size of default input buffer. */
+ #define YY_BUF_SIZE 16384
+
+ typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+ extern int yyleng;
+ extern FILE *yyin, *yyout;
+
+ #define EOB_ACT_CONTINUE_SCAN 0
+ #define EOB_ACT_END_OF_FILE 1
+ #define EOB_ACT_LAST_MATCH 2
+
+ /* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator). This
+ * avoids problems with code like:
+ *
+ * if ( condition_holds )
+ * yyless( 5 );
+ * else
+ * do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+ /* Return all but the first 'n' matched characters back to the input stream. */
+
+ #define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ *yy_cp = yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+ #define unput(c) yyunput( c, yytext_ptr )
+
+ /* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+ typedef unsigned int yy_size_t;
+
+
+ struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+ #define YY_BUFFER_NEW 0
+ #define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+ #define YY_BUFFER_EOF_PENDING 2
+ };
+
+ static YY_BUFFER_STATE yy_current_buffer = 0;
+
+ /* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+ #define YY_CURRENT_BUFFER yy_current_buffer
+
+
+ /* yy_hold_char holds the character lost when yytext is formed. */
+ static char yy_hold_char;
+
+ static int yy_n_chars; /* number of characters read into yy_ch_buf */
+
+
+ int yyleng;
+
+ /* Points to current character in buffer. */
+ static char *yy_c_buf_p = (char *) 0;
+ static int yy_init = 1; /* whether we need to initialize */
+ static int yy_start = 0; /* start state number */
+
+ /* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+ static int yy_did_buffer_switch_on_eof;
+
+ void yyrestart YY_PROTO(( FILE *input_file ));
+
+ void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+ void yy_load_buffer_state YY_PROTO(( void ));
+ YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+ void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+ void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+ void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+ #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+ YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+ YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+ YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+ static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+ static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+ static void yy_flex_free YY_PROTO(( void * ));
+
+ #define yy_new_buffer yy_create_buffer
+
+ #define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_is_interactive = is_interactive; \
+ }
+
+ #define yy_set_bol(at_bol) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_at_bol = at_bol; \
+ }
+
+ #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+ #define YY_USES_REJECT
+
+ #define yywrap() 1
+ #define YY_SKIP_YYWRAP
+ typedef unsigned char YY_CHAR;
+ FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+ typedef int yy_state_type;
+ #define YY_FLEX_LEX_COMPAT
+ extern int yylineno;
+ int yylineno = 1;
+ extern char yytext[];
+
+
+ static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+ static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+ static int yy_get_next_buffer YY_PROTO(( void ));
+ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+ /* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+ #define YY_DO_BEFORE_ACTION \
+ yytext_ptr = yy_bp; \
+ yyleng = (int) (yy_cp - yy_bp); \
+ yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ if ( yyleng + yy_more_offset >= YYLMAX ) \
+ YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \
+ yy_flex_strncpy( &yytext[yy_more_offset], yytext_ptr, yyleng + 1 ); \
+ yyleng += yy_more_offset; \
+ yy_prev_more_offset = yy_more_offset; \
+ yy_more_offset = 0; \
+ yy_c_buf_p = yy_cp;
+
+ #define YY_NUM_RULES 31
+ #define YY_END_OF_BUFFER 32
+ static yyconst short int yy_acclist[414] =
+ { 0,
+ 32, 29, 31, 28, 29, 31, 30, 31, 19, 29,
+ 31, 8, 29, 31, 1, 29, 31, 29, 31, 12,
+ 29, 31, 25, 29, 31, 25, 29, 31, 19, 29,
+ 31, 27, 29, 31,16407, 27, 29, 31,16407, 27,
+ 29, 31,16407, 19, 29, 31, 27, 29, 31,16407,
+ 27, 29, 31,16407, 27, 29, 31,16407, 27, 29,
+ 31,16407, 27, 29, 31,16407, 27, 29, 31,16407,
+ 27, 29, 31,16407, 27, 29, 31,16407, 27, 29,
+ 31,16407, 27, 29, 31,16407, 27, 29, 31,16407,
+ 27, 29, 31,16407, 27, 29, 31,16407, 27, 29,
+
+ 31,16407, 27, 29, 31,16407, 27, 29, 31,16407,
+ 27, 29, 31,16407, 27, 29, 31,16407, 19, 20,
+ 29, 31, 16, 18, 29, 31,16406, 19, 29, 31,
+ 29, 31, 2, 30, 31, 11, 29, 31, 29, 31,
+ 15, 29, 31, 29, 31, 5, 6, 25, 25, 24,
+ 26, 8215, 27,16407, 27,16407, 27,16407, 7, 27,
+ 16407, 27,16407, 27,16407, 27,16407, 27,16407, 27,
+ 16407, 27,16407, 27,16407, 17, 27,16405,16407, 27,
+ 16407, 27,16407, 27,16407, 27,16407, 17, 27,16405,
+ 16407, 27,16407, 27,16407, 27,16407, 27,16407, 27,
+
+ 16407, 17, 27,16405,16407, 27,16407, 27,16407, 27,
+ 16407, 27,16407, 27,16407, 27,16407, 27,16407, 27,
+ 16407, 27,16407, 8214, 10, 9, 14, 13, 25, 25,
+ 25, 24, 27,16407, 27,16407, 27,16407, 27,16407,
+ 27,16407, 27,16407, 27,16407, 27,16407, 27,16407,
+ 17, 27,16405,16407, 8213, 8215, 27,16407, 27,16407,
+ 27,16407, 27,16407, 27,16407, 27,16407, 27,16407,
+ 27,16407, 27,16407, 17, 27,16405,16407, 27,16407,
+ 27,16407, 27,16407, 27,16407, 27,16407, 27,16407,
+ 27,16407, 27,16407, 27,16407, 27,16407, 27,16407,
+
+ 27,16407, 27,16407, 27,16407, 27,16407, 27,16407,
+ 25, 27,16407, 27,16407, 27,16407, 27,16407, 27,
+ 16407, 27,16407, 27,16407, 27,16407, 27,16407, 27,
+ 16407, 27,16407, 17, 27,16405,16407, 27,16407, 27,
+ 16407, 27,16407, 27,16407, 27,16407, 27,16407, 27,
+ 16407, 27,16407, 27,16407, 27,16407, 27,16407, 27,
+ 16407, 27,16407, 27,16407, 27,16407, 4, 27,16407,
+ 27,16407, 17, 27,16405,16407, 27,16407, 27,16407,
+ 27,16407, 27,16407, 27,16407, 27,16407, 27,16407,
+ 27,16407, 27,16407, 27,16407, 17, 27,16405,16407,
+
+ 27,16407, 27,16407, 3, 27,16407, 27,16407, 17,
+ 27,16405,16407
+ } ;
+
+ static yyconst short int yy_accept[201] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 4, 7, 9, 12, 15, 18, 20, 23,
+ 26, 29, 32, 36, 40, 44, 47, 51, 55, 59,
+ 63, 67, 71, 75, 79, 83, 87, 91, 95, 99,
+ 103, 107, 111, 115, 119, 123, 128, 131, 133, 136,
+ 139, 141, 144, 146, 147, 148, 149, 150, 151, 151,
+ 152, 152, 153, 155, 157, 159, 160, 162, 164, 166,
+ 168, 170, 172, 174, 176, 180, 182, 184, 186, 188,
+ 192, 194, 196, 198, 200, 202, 206, 208, 210, 212,
+ 214, 216, 218, 220, 222, 224, 224, 225, 225, 225,
+
+ 226, 227, 228, 229, 230, 231, 232, 233, 235, 237,
+ 239, 241, 243, 245, 247, 249, 251, 255, 255, 257,
+ 259, 261, 263, 265, 267, 269, 271, 273, 275, 279,
+ 281, 283, 285, 287, 289, 291, 293, 295, 297, 299,
+ 301, 303, 305, 307, 309, 311, 311, 311, 312, 314,
+ 316, 318, 320, 322, 324, 326, 328, 330, 332, 334,
+ 338, 340, 342, 344, 346, 348, 350, 352, 354, 356,
+ 358, 360, 362, 364, 366, 368, 368, 369, 371, 373,
+ 377, 379, 381, 383, 385, 387, 389, 391, 393, 393,
+ 395, 397, 401, 403, 405, 406, 408, 410, 414, 414
+
+ } ;
+
+ static yyconst int yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 5, 6, 7, 8, 9, 6, 6, 10, 11,
+ 6, 6, 12, 6, 12, 13, 6, 14, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 6, 6, 16,
+ 17, 18, 6, 1, 19, 20, 19, 21, 22, 23,
+ 24, 25, 26, 25, 25, 27, 25, 28, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 29, 25, 25,
+ 6, 30, 6, 6, 31, 1, 32, 33, 34, 35,
+
+ 36, 37, 38, 39, 40, 25, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 25, 52, 53,
+ 54, 25, 55, 6, 55, 6, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+ static yyconst int yy_meta[57] =
+ { 0,
+ 1, 2, 3, 2, 3, 1, 4, 1, 1, 1,
+ 2, 1, 1, 5, 5, 1, 1, 1, 5, 5,
+ 5, 5, 5, 2, 2, 2, 2, 2, 2, 1,
+ 2, 5, 5, 5, 5, 5, 5, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 1, 1
+ } ;
+
+ static yyconst short int yy_base[204] =
+ { 0,
+ 0, 164, 55, 57, 59, 61, 63, 65, 73, 75,
+ 174, 1121, 1121, 1121, 1121, 1121, 1121, 72, 1121, 73,
+ 76, 154, 95, 105, 109, 157, 119, 129, 140, 150,
+ 154, 164, 175, 191, 207, 211, 221, 234, 238, 260,
+ 273, 283, 287, 297, 1121, 302, 116, 105, 1121, 1121,
+ 62, 1121, 71, 1121, 1121, 103, 133, 0, 120, 101,
+ 312, 1121, 327, 331, 341, 1121, 345, 355, 371, 375,
+ 385, 389, 399, 412, 422, 432, 442, 452, 456, 467,
+ 471, 482, 494, 504, 508, 518, 522, 561, 493, 154,
+ 501, 334, 510, 533, 304, 573, 1121, 68, 52, 1121,
+
+ 1121, 1121, 1121, 114, 148, 215, 0, 415, 506, 544,
+ 539, 550, 566, 362, 275, 184, 601, 615, 1121, 587,
+ 593, 603, 611, 620, 616, 629, 633, 624, 628, 642,
+ 650, 655, 673, 663, 680, 689, 684, 697, 705, 713,
+ 721, 726, 730, 743, 747, 56, 49, 121, 753, 737,
+ 763, 769, 773, 780, 789, 796, 800, 805, 813, 854,
+ 831, 835, 841, 857, 861, 865, 870, 878, 883, 887,
+ 903, 894, 907, 911, 916, 40, 1121, 933, 937, 974,
+ 953, 957, 961, 977, 970, 986, 981, 994, 29, 1003,
+ 1011, 1052, 1029, 1033, 1121, 1039, 1046, 1095, 1121, 1106,
+
+ 1111, 1115, 66
+ } ;
+
+ static yyconst short int yy_def[204] =
+ { 0,
+ 199, 1, 200, 200, 200, 200, 200, 200, 200, 200,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 201, 202, 202, 202, 199, 202, 202, 202, 202,
+ 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
+ 202, 202, 202, 202, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 203, 201, 201,
+ 199, 199, 202, 202, 202, 199, 202, 202, 202, 202,
+ 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
+ 202, 202, 202, 202, 202, 202, 202, 202, 88, 88,
+ 88, 88, 88, 88, 88, 199, 199, 199, 199, 199,
+
+ 199, 199, 199, 199, 199, 199, 203, 88, 88, 88,
+ 88, 88, 88, 88, 88, 88, 202, 199, 199, 88,
+ 88, 88, 88, 88, 88, 88, 88, 88, 202, 88,
+ 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
+ 88, 88, 88, 88, 88, 199, 199, 199, 88, 88,
+ 88, 88, 88, 88, 88, 88, 88, 88, 88, 202,
+ 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
+ 88, 88, 88, 88, 88, 199, 199, 88, 88, 202,
+ 88, 88, 88, 88, 88, 88, 88, 88, 199, 88,
+ 88, 202, 88, 88, 199, 88, 88, 202, 0, 199,
+
+ 199, 199, 199
+ } ;
+
+ static yyconst short int yy_nxt[1178] =
+ { 0,
+ 12, 13, 14, 12, 12, 15, 16, 17, 18, 19,
+ 15, 15, 15, 20, 21, 22, 15, 15, 23, 24,
+ 23, 25, 23, 23, 23, 23, 23, 23, 23, 26,
+ 27, 28, 29, 30, 31, 32, 33, 23, 23, 34,
+ 23, 35, 36, 37, 38, 23, 23, 39, 40, 41,
+ 42, 43, 23, 44, 45, 46, 13, 14, 13, 14,
+ 13, 49, 13, 49, 13, 14, 13, 14, 100, 50,
+ 107, 50, 195, 48, 13, 14, 13, 14, 54, 189,
+ 102, 55, 52, 177, 52, 56, 57, 57, 56, 57,
+ 57, 101, 51, 176, 51, 147, 61, 61, 61, 61,
+
+ 103, 58, 53, 146, 53, 62, 61, 61, 61, 61,
+ 61, 61, 61, 61, 104, 62, 105, 105, 60, 62,
+ 61, 61, 61, 61, 106, 58, 64, 148, 148, 62,
+ 61, 61, 61, 61, 148, 148, 65, 60, 106, 62,
+ 99, 61, 61, 61, 61, 56, 57, 57, 98, 67,
+ 62, 61, 61, 61, 61, 61, 61, 61, 61, 104,
+ 62, 105, 105, 66, 62, 61, 61, 61, 61, 106,
+ 68, 60, 69, 199, 62, 70, 61, 61, 61, 61,
+ 47, 72, 199, 106, 199, 62, 199, 71, 63, 74,
+ 199, 73, 61, 61, 61, 61, 199, 199, 75, 136,
+
+ 63, 62, 63, 63, 199, 76, 78, 77, 61, 61,
+ 61, 61, 61, 61, 61, 61, 199, 62, 63, 79,
+ 199, 62, 61, 61, 61, 61, 104, 75, 148, 148,
+ 63, 62, 156, 63, 80, 61, 61, 61, 61, 61,
+ 61, 61, 61, 199, 62, 199, 199, 199, 62, 199,
+ 199, 81, 199, 199, 199, 82, 83, 199, 199, 199,
+ 84, 61, 61, 61, 61, 85, 199, 199, 199, 87,
+ 62, 199, 199, 88, 61, 61, 61, 61, 199, 199,
+ 199, 86, 199, 62, 61, 61, 61, 61, 61, 61,
+ 61, 61, 199, 62, 199, 89, 199, 62, 61, 61,
+
+ 61, 61, 199, 96, 96, 96, 96, 62, 155, 63,
+ 90, 91, 97, 61, 61, 61, 61, 199, 199, 199,
+ 92, 63, 62, 63, 63, 94, 93, 199, 61, 61,
+ 61, 61, 61, 61, 61, 61, 95, 62, 63, 145,
+ 199, 62, 61, 61, 61, 61, 61, 61, 61, 61,
+ 63, 62, 63, 63, 108, 62, 61, 61, 61, 61,
+ 199, 75, 199, 199, 199, 62, 199, 109, 63, 199,
+ 199, 110, 61, 61, 61, 61, 61, 61, 61, 61,
+ 63, 62, 63, 63, 139, 62, 61, 61, 61, 61,
+ 61, 61, 61, 61, 111, 62, 63, 75, 199, 62,
+
+ 61, 61, 61, 61, 199, 86, 199, 199, 63, 62,
+ 63, 63, 112, 61, 61, 61, 61, 199, 199, 199,
+ 113, 199, 62, 118, 118, 118, 118, 199, 199, 199,
+ 116, 199, 119, 61, 61, 61, 61, 114, 115, 199,
+ 149, 199, 62, 61, 61, 61, 61, 199, 117, 63,
+ 199, 199, 62, 61, 61, 61, 61, 61, 61, 61,
+ 61, 63, 62, 63, 63, 199, 62, 199, 118, 118,
+ 118, 118, 61, 61, 61, 61, 75, 119, 199, 199,
+ 120, 62, 199, 61, 61, 61, 61, 199, 199, 199,
+ 121, 122, 62, 123, 199, 61, 61, 61, 61, 199,
+
+ 124, 199, 125, 75, 62, 61, 61, 61, 61, 61,
+ 61, 61, 61, 199, 62, 126, 127, 199, 62, 118,
+ 118, 118, 118, 61, 61, 61, 61, 63, 119, 199,
+ 199, 150, 62, 199, 135, 63, 137, 199, 199, 63,
+ 63, 63, 63, 199, 140, 129, 128, 63, 138, 63,
+ 63, 141, 63, 199, 63, 63, 63, 86, 63, 142,
+ 199, 130, 61, 61, 61, 61, 199, 63, 143, 151,
+ 152, 62, 144, 63, 96, 96, 96, 96, 63, 63,
+ 199, 63, 63, 97, 63, 63, 199, 63, 63, 153,
+ 63, 199, 63, 63, 199, 131, 63, 154, 63, 63,
+
+ 63, 199, 118, 118, 118, 118, 199, 132, 199, 133,
+ 134, 119, 63, 199, 63, 63, 118, 118, 118, 118,
+ 199, 63, 75, 199, 199, 119, 158, 63, 199, 118,
+ 118, 118, 118, 63, 199, 63, 63, 63, 119, 63,
+ 157, 63, 63, 159, 160, 63, 199, 199, 199, 63,
+ 160, 63, 63, 199, 63, 199, 199, 63, 63, 161,
+ 63, 162, 63, 63, 63, 63, 63, 63, 63, 63,
+ 63, 199, 63, 75, 75, 63, 63, 63, 63, 63,
+ 199, 63, 63, 163, 63, 199, 199, 199, 63, 63,
+ 164, 63, 199, 199, 75, 199, 63, 63, 63, 63,
+
+ 199, 63, 199, 63, 63, 165, 166, 63, 199, 63,
+ 167, 63, 63, 168, 63, 199, 129, 199, 63, 63,
+ 199, 63, 63, 63, 169, 199, 63, 75, 63, 63,
+ 63, 63, 63, 63, 199, 63, 199, 63, 63, 63,
+ 129, 170, 199, 63, 199, 63, 63, 63, 171, 199,
+ 199, 63, 199, 63, 63, 63, 172, 199, 199, 63,
+ 63, 63, 63, 178, 63, 173, 199, 63, 199, 63,
+ 63, 63, 63, 75, 63, 63, 63, 63, 63, 63,
+ 75, 63, 199, 63, 174, 63, 63, 63, 175, 63,
+ 179, 63, 63, 63, 199, 63, 63, 63, 199, 63,
+
+ 199, 63, 63, 63, 199, 199, 199, 63, 199, 63,
+ 199, 63, 63, 199, 63, 63, 75, 75, 63, 63,
+ 75, 63, 63, 63, 199, 199, 63, 160, 63, 63,
+ 63, 199, 199, 199, 63, 63, 199, 63, 63, 63,
+ 199, 75, 63, 181, 180, 63, 63, 63, 63, 63,
+ 199, 63, 199, 63, 63, 118, 118, 118, 118, 63,
+ 182, 63, 63, 199, 119, 63, 129, 199, 199, 63,
+ 199, 199, 199, 199, 199, 63, 199, 63, 199, 63,
+ 63, 63, 184, 63, 63, 183, 199, 63, 199, 63,
+ 63, 63, 75, 199, 199, 63, 199, 199, 199, 63,
+
+ 185, 199, 199, 63, 63, 63, 63, 63, 199, 63,
+ 63, 63, 63, 63, 63, 186, 63, 63, 63, 63,
+ 199, 63, 199, 75, 63, 187, 63, 63, 63, 63,
+ 75, 63, 63, 63, 199, 63, 63, 63, 160, 75,
+ 63, 63, 188, 63, 199, 63, 75, 199, 75, 63,
+ 75, 63, 63, 63, 190, 63, 63, 63, 191, 63,
+ 63, 199, 63, 199, 63, 63, 199, 63, 199, 199,
+ 199, 63, 199, 199, 199, 118, 118, 118, 118, 63,
+ 199, 63, 63, 63, 119, 63, 63, 63, 192, 199,
+ 199, 63, 75, 199, 199, 193, 199, 199, 199, 63,
+
+ 199, 63, 63, 63, 63, 63, 63, 63, 199, 63,
+ 63, 63, 180, 199, 199, 63, 63, 194, 63, 63,
+ 63, 75, 199, 63, 75, 63, 63, 63, 63, 63,
+ 63, 199, 63, 196, 63, 63, 199, 63, 199, 199,
+ 63, 197, 75, 63, 199, 63, 199, 199, 199, 63,
+ 199, 63, 63, 118, 118, 118, 118, 63, 199, 63,
+ 63, 199, 119, 63, 160, 199, 199, 63, 160, 129,
+ 199, 199, 199, 63, 199, 63, 129, 63, 63, 63,
+ 63, 63, 63, 199, 199, 63, 198, 63, 63, 199,
+ 199, 199, 63, 199, 63, 63, 118, 118, 118, 118,
+
+ 199, 199, 199, 199, 199, 119, 12, 12, 12, 12,
+ 12, 59, 59, 199, 199, 59, 63, 63, 199, 63,
+ 11, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199
+ } ;
+
+ static yyconst short int yy_chk[1178] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 3, 3, 4, 4,
+ 5, 5, 6, 6, 7, 7, 8, 8, 51, 7,
+ 203, 8, 189, 4, 9, 9, 10, 10, 18, 176,
+ 53, 18, 9, 147, 10, 20, 20, 20, 21, 21,
+ 21, 51, 7, 146, 8, 99, 23, 23, 23, 23,
+
+ 53, 20, 9, 98, 10, 23, 24, 24, 24, 24,
+ 25, 25, 25, 25, 56, 24, 56, 56, 60, 25,
+ 27, 27, 27, 27, 56, 20, 24, 104, 104, 27,
+ 28, 28, 28, 28, 148, 148, 25, 59, 56, 28,
+ 48, 29, 29, 29, 29, 57, 57, 57, 47, 27,
+ 29, 30, 30, 30, 30, 31, 31, 31, 31, 105,
+ 30, 105, 105, 26, 31, 32, 32, 32, 32, 105,
+ 28, 22, 28, 11, 32, 29, 33, 33, 33, 33,
+ 2, 30, 0, 105, 0, 33, 0, 29, 90, 31,
+ 0, 30, 34, 34, 34, 34, 0, 0, 31, 90,
+
+ 90, 34, 90, 90, 0, 32, 33, 32, 35, 35,
+ 35, 35, 36, 36, 36, 36, 0, 35, 116, 33,
+ 0, 36, 37, 37, 37, 37, 106, 34, 106, 106,
+ 116, 37, 116, 116, 34, 38, 38, 38, 38, 39,
+ 39, 39, 39, 0, 38, 0, 0, 0, 39, 0,
+ 0, 35, 0, 0, 0, 36, 37, 0, 0, 0,
+ 37, 40, 40, 40, 40, 37, 0, 0, 0, 39,
+ 40, 0, 0, 39, 41, 41, 41, 41, 0, 0,
+ 0, 38, 0, 41, 42, 42, 42, 42, 43, 43,
+ 43, 43, 0, 42, 0, 40, 0, 43, 44, 44,
+
+ 44, 44, 0, 46, 46, 46, 46, 44, 115, 115,
+ 40, 41, 46, 61, 61, 61, 61, 0, 0, 0,
+ 41, 115, 61, 115, 115, 43, 42, 0, 63, 63,
+ 63, 63, 64, 64, 64, 64, 44, 63, 95, 95,
+ 0, 64, 65, 65, 65, 65, 67, 67, 67, 67,
+ 95, 65, 95, 95, 64, 67, 68, 68, 68, 68,
+ 0, 65, 0, 0, 0, 68, 0, 67, 92, 0,
+ 0, 67, 69, 69, 69, 69, 70, 70, 70, 70,
+ 92, 69, 92, 92, 92, 70, 71, 71, 71, 71,
+ 72, 72, 72, 72, 68, 71, 114, 114, 0, 72,
+
+ 73, 73, 73, 73, 0, 69, 0, 0, 114, 73,
+ 114, 114, 70, 74, 74, 74, 74, 0, 0, 0,
+ 71, 0, 74, 75, 75, 75, 75, 0, 0, 0,
+ 73, 0, 75, 76, 76, 76, 76, 72, 72, 0,
+ 108, 0, 76, 77, 77, 77, 77, 0, 74, 108,
+ 0, 0, 77, 78, 78, 78, 78, 79, 79, 79,
+ 79, 108, 78, 108, 108, 0, 79, 0, 80, 80,
+ 80, 80, 81, 81, 81, 81, 77, 80, 0, 0,
+ 76, 81, 0, 82, 82, 82, 82, 0, 0, 0,
+ 77, 78, 82, 78, 0, 83, 83, 83, 83, 0,
+
+ 80, 0, 81, 79, 83, 84, 84, 84, 84, 85,
+ 85, 85, 85, 0, 84, 81, 82, 0, 85, 86,
+ 86, 86, 86, 87, 87, 87, 87, 89, 86, 0,
+ 0, 109, 87, 0, 89, 91, 91, 0, 0, 89,
+ 109, 89, 89, 0, 93, 84, 83, 91, 91, 91,
+ 91, 93, 109, 0, 109, 109, 93, 85, 93, 93,
+ 0, 87, 88, 88, 88, 88, 0, 94, 94, 110,
+ 111, 88, 94, 111, 96, 96, 96, 96, 110, 94,
+ 0, 94, 94, 96, 112, 111, 0, 111, 111, 112,
+ 110, 0, 110, 110, 0, 88, 112, 113, 112, 112,
+
+ 113, 0, 117, 117, 117, 117, 0, 88, 0, 88,
+ 88, 117, 113, 0, 113, 113, 118, 118, 118, 118,
+ 0, 120, 120, 0, 0, 118, 120, 121, 0, 129,
+ 129, 129, 129, 120, 0, 120, 120, 122, 129, 121,
+ 117, 121, 121, 121, 122, 123, 0, 0, 0, 122,
+ 125, 122, 122, 0, 124, 0, 0, 123, 128, 123,
+ 123, 124, 125, 126, 125, 125, 124, 127, 124, 124,
+ 128, 0, 128, 128, 126, 126, 130, 126, 126, 127,
+ 0, 127, 127, 127, 131, 0, 0, 0, 130, 132,
+ 130, 130, 0, 0, 131, 0, 131, 134, 131, 131,
+
+ 0, 132, 0, 132, 132, 132, 133, 133, 0, 134,
+ 134, 134, 134, 134, 135, 0, 135, 0, 137, 133,
+ 0, 133, 133, 136, 136, 0, 135, 137, 135, 135,
+ 137, 138, 137, 137, 0, 136, 0, 136, 136, 139,
+ 139, 138, 0, 138, 0, 138, 138, 140, 140, 0,
+ 0, 139, 0, 139, 139, 141, 141, 0, 0, 140,
+ 142, 140, 140, 150, 143, 142, 0, 141, 0, 141,
+ 141, 150, 142, 143, 142, 142, 143, 144, 143, 143,
+ 149, 145, 0, 150, 144, 150, 150, 149, 145, 144,
+ 151, 144, 144, 145, 0, 145, 145, 151, 0, 149,
+
+ 0, 149, 149, 152, 0, 0, 0, 153, 0, 151,
+ 0, 151, 151, 0, 154, 152, 153, 152, 152, 153,
+ 154, 153, 153, 155, 0, 0, 154, 155, 154, 154,
+ 156, 0, 0, 0, 157, 155, 0, 155, 155, 158,
+ 0, 158, 156, 157, 156, 156, 157, 159, 157, 157,
+ 0, 158, 0, 158, 158, 160, 160, 160, 160, 159,
+ 159, 159, 159, 0, 160, 161, 161, 0, 0, 162,
+ 0, 0, 0, 0, 0, 163, 0, 161, 0, 161,
+ 161, 162, 163, 162, 162, 162, 0, 163, 0, 163,
+ 163, 164, 164, 0, 0, 165, 0, 0, 0, 166,
+
+ 165, 0, 0, 164, 167, 164, 164, 165, 0, 165,
+ 165, 166, 168, 166, 166, 166, 167, 169, 167, 167,
+ 0, 170, 0, 167, 168, 168, 168, 168, 172, 169,
+ 169, 169, 169, 170, 0, 170, 170, 171, 170, 171,
+ 172, 173, 172, 172, 0, 174, 174, 0, 173, 171,
+ 175, 171, 171, 173, 178, 173, 173, 174, 179, 174,
+ 174, 0, 175, 0, 175, 175, 0, 178, 0, 0,
+ 0, 179, 0, 0, 0, 180, 180, 180, 180, 178,
+ 0, 178, 178, 179, 180, 179, 179, 181, 181, 0,
+ 0, 182, 182, 0, 0, 183, 0, 0, 0, 181,
+
+ 0, 181, 181, 182, 185, 182, 182, 183, 0, 183,
+ 183, 184, 184, 0, 0, 187, 185, 185, 185, 185,
+ 186, 186, 0, 184, 187, 184, 184, 187, 188, 187,
+ 187, 0, 186, 190, 186, 186, 0, 190, 0, 0,
+ 188, 191, 188, 188, 0, 191, 0, 0, 0, 190,
+ 0, 190, 190, 192, 192, 192, 192, 191, 0, 191,
+ 191, 0, 192, 193, 193, 0, 0, 194, 194, 196,
+ 0, 0, 0, 196, 0, 193, 197, 193, 193, 194,
+ 197, 194, 194, 0, 0, 196, 192, 196, 196, 0,
+ 0, 0, 197, 0, 197, 197, 198, 198, 198, 198,
+
+ 0, 0, 0, 0, 0, 198, 200, 200, 200, 200,
+ 200, 201, 201, 0, 0, 201, 202, 202, 0, 202,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199
+ } ;
+
+ static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
+ static char *yy_full_match;
+ static int yy_lp;
+ static int yy_looking_for_trail_begin = 0;
+ static int yy_full_lp;
+ static int *yy_full_state;
+ #define YY_TRAILING_MASK 0x2000
+ #define YY_TRAILING_HEAD_MASK 0x4000
+ #define REJECT \
+ { \
+ *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
+ yy_cp = yy_full_match; /* restore poss. backed-over text */ \
+ yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
+ yy_state_ptr = yy_full_state; /* restore orig. state */ \
+ yy_current_state = *yy_state_ptr; /* restore curr. state */ \
+ ++yy_lp; \
+ goto find_rule; \
+ }
+ static int yy_more_offset = 0;
+ static int yy_prev_more_offset = 0;
+ #define yymore() (yy_more_offset = yy_flex_strlen( yytext ))
+ #define YY_NEED_STRLEN
+ #define YY_MORE_ADJ 0
+ #define YY_RESTORE_YY_MORE_OFFSET \
+ { \
+ yy_more_offset = yy_prev_more_offset; \
+ yyleng -= yy_more_offset; \
+ }
+ #ifndef YYLMAX
+ #define YYLMAX 8192
+ #endif
+
+ char yytext[YYLMAX];
+ char *yytext_ptr;
+ #line 1 "ruby_scanner.ll"
+ #define INITIAL 0
+ #line 2 "ruby_scanner.ll"
+ /*
+ * Copyright (C) 2003 Noritsugu Nakamura
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+ /*
+ Scanner for ruby, version 0.0.0
+ Written by Noritsugu Nakamura
+ */
+
+ static int lineno = 1 ; /* number of scanned lines */
+ //char linebuf[1024] ; /* current code line in the source */
+ //int tokenpos = 0 ; /* current token position in the current line */
+
+ //#include "tags.h"
+ //#include "tokens.h"
+ //#include "colors.h"
+
+ #include "genfun.h"
+
+ #define COMMENT_STATE 1
+
+ #define SINGLELINE_COMMENT 2
+
+ #define STRING_STATE 3
+
+ #define CHAR_STATE 4
+
+ #line 838 "ruby_scanner.cc"
+
+ /* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+ #ifndef YY_SKIP_YYWRAP
+ #ifdef __cplusplus
+ extern "C" int yywrap YY_PROTO(( void ));
+ #else
+ extern int yywrap YY_PROTO(( void ));
+ #endif
+ #endif
+
+ #ifndef YY_NO_UNPUT
+ static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+ #endif
+
+ #ifndef yytext_ptr
+ static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+ #endif
+
+ #ifdef YY_NEED_STRLEN
+ static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+ #endif
+
+ #ifndef YY_NO_INPUT
+ #ifdef __cplusplus
+ static int yyinput YY_PROTO(( void ));
+ #else
+ static int input YY_PROTO(( void ));
+ #endif
+ #endif
+
+ #if YY_STACK_USED
+ static int yy_start_stack_ptr = 0;
+ static int yy_start_stack_depth = 0;
+ static int *yy_start_stack = 0;
+ #ifndef YY_NO_PUSH_STATE
+ static void yy_push_state YY_PROTO(( int new_state ));
+ #endif
+ #ifndef YY_NO_POP_STATE
+ static void yy_pop_state YY_PROTO(( void ));
+ #endif
+ #ifndef YY_NO_TOP_STATE
+ static int yy_top_state YY_PROTO(( void ));
+ #endif
+
+ #else
+ #define YY_NO_PUSH_STATE 1
+ #define YY_NO_POP_STATE 1
+ #define YY_NO_TOP_STATE 1
+ #endif
+
+ #ifdef YY_MALLOC_DECL
+ YY_MALLOC_DECL
+ #else
+ #if __STDC__
+ #ifndef __cplusplus
+ #include
+ #endif
+ #else
+ /* Just try to get by without declaring the routines. This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+ #endif
+ #endif
+
+ /* Amount of stuff to slurp up with each read. */
+ #ifndef YY_READ_BUF_SIZE
+ #define YY_READ_BUF_SIZE 8192
+ #endif
+
+ /* Copy whatever the last rule matched to the standard output. */
+
+ #ifndef ECHO
+ /* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+ #endif
+
+ /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+ #ifndef YY_INPUT
+ #define YY_INPUT(buf,result,max_size) \
+ if ( yy_current_buffer->yy_is_interactive ) \
+ { \
+ int c = '*', n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+ && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
+ #endif
+
+ /* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+ #ifndef yyterminate
+ #define yyterminate() return YY_NULL
+ #endif
+
+ /* Number of entries by which start-condition stack grows. */
+ #ifndef YY_START_STACK_INCR
+ #define YY_START_STACK_INCR 25
+ #endif
+
+ /* Report a fatal error. */
+ #ifndef YY_FATAL_ERROR
+ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+ #endif
+
+ /* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+ #ifndef YY_DECL
+ #define YY_DECL int yylex YY_PROTO(( void ))
+ #endif
+
+ /* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+ #ifndef YY_USER_ACTION
+ #define YY_USER_ACTION
+ #endif
+
+ /* Code executed at the end of each rule. */
+ #ifndef YY_BREAK
+ #define YY_BREAK break;
+ #endif
+
+ #define YY_RULE_SETUP \
+ if ( yyleng > 0 ) \
+ yy_current_buffer->yy_at_bol = \
+ (yytext[yyleng - 1] == '\n'); \
+ YY_USER_ACTION
+
+ YY_DECL
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+
+ #line 68 "ruby_scanner.ll"
+
+
+ #line 995 "ruby_scanner.cc"
+
+ if ( yy_init )
+ {
+ yy_init = 0;
+
+ #ifdef YY_USER_INIT
+ YY_USER_INIT;
+ #endif
+
+ if ( ! yy_start )
+ yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! yy_current_buffer )
+ yy_current_buffer =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_load_buffer_state();
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yy_start;
+ yy_current_state += YY_AT_BOL();
+ yy_state_ptr = yy_state_buf;
+ *yy_state_ptr++ = yy_current_state;
+ yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 200 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ *yy_state_ptr++ = yy_current_state;
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 1121 );
+
+ yy_find_action:
+ yy_current_state = *--yy_state_ptr;
+ yy_lp = yy_accept[yy_current_state];
+ find_rule: /* we branch to this label when backing up */
+ for ( ; ; ) /* until we find what rule we matched */
+ {
+ if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
+ {
+ yy_act = yy_acclist[yy_lp];
+ if ( yy_act & YY_TRAILING_HEAD_MASK ||
+ yy_looking_for_trail_begin )
+ {
+ if ( yy_act == yy_looking_for_trail_begin )
+ {
+ yy_looking_for_trail_begin = 0;
+ yy_act &= ~YY_TRAILING_HEAD_MASK;
+ break;
+ }
+ }
+ else if ( yy_act & YY_TRAILING_MASK )
+ {
+ yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
+ yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
+ yy_full_match = yy_cp;
+ yy_full_state = yy_state_ptr;
+ yy_full_lp = yy_lp;
+ }
+ else
+ {
+ yy_full_match = yy_cp;
+ yy_full_state = yy_state_ptr;
+ yy_full_lp = yy_lp;
+ break;
+ }
+ ++yy_lp;
+ goto find_rule;
+ }
+ --yy_cp;
+ yy_current_state = *--yy_state_ptr;
+ yy_lp = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+ if ( yy_act != YY_END_OF_BUFFER )
+ {
+ int yyl;
+ for ( yyl = 0; yyl < yyleng; ++yyl )
+ if ( yytext[yyl] == '\n' )
+ ++yylineno;
+ }
+
+ do_action: /* This label is used only to access EOF actions. */
+
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 1:
+ YY_RULE_SETUP
+ #line 70 "ruby_scanner.ll"
+ { BEGIN SINGLELINE_COMMENT ; startComment( yytext ) ; }
+ YY_BREAK
+ case 2:
+ YY_RULE_SETUP
+ #line 71 "ruby_scanner.ll"
+ {
+ BEGIN INITIAL ;
+ yyless (0); // put the \n back
+ endComment( yytext ) ;
+ /* if we encounter another # during a comment we simply
+ treat it as a ordinary string */
+ }
+ YY_BREAK
+ case 3:
+ YY_RULE_SETUP
+ #line 78 "ruby_scanner.ll"
+ { BEGIN COMMENT_STATE ;
+ startComment( yytext ) ;
+ }
+ YY_BREAK
+ case 4:
+ YY_RULE_SETUP
+ #line 81 "ruby_scanner.ll"
+ { endComment(yytext) ;
+ BEGIN INITIAL ; /* end of rd doc */ }
+ YY_BREAK
+ case 5:
+ YY_RULE_SETUP
+ #line 85 "ruby_scanner.ll"
+ { generate_normal( yytext ); }
+ YY_BREAK
+ case 6:
+ YY_RULE_SETUP
+ #line 86 "ruby_scanner.ll"
+ { generate_normal( yytext ); }
+ YY_BREAK
+ case 7:
+ YY_RULE_SETUP
+ #line 87 "ruby_scanner.ll"
+ { generate_normal( yytext ); }
+ YY_BREAK
+ case 8:
+ YY_RULE_SETUP
+ #line 89 "ruby_scanner.ll"
+ { BEGIN STRING_STATE ; startString( yytext ); }
+ YY_BREAK
+ case 9:
+ YY_RULE_SETUP
+ #line 90 "ruby_scanner.ll"
+ { generate_preproc( yytext ) ; }
+ YY_BREAK
+ case 10:
+ YY_RULE_SETUP
+ #line 91 "ruby_scanner.ll"
+ { generate_preproc( yytext ) ; }
+ YY_BREAK
+ case 11:
+ YY_RULE_SETUP
+ #line 92 "ruby_scanner.ll"
+ { BEGIN INITIAL ; endString( yytext ) ; }
+ YY_BREAK
+ case 12:
+ YY_RULE_SETUP
+ #line 94 "ruby_scanner.ll"
+ { BEGIN CHAR_STATE ; startString( yytext ); }
+ YY_BREAK
+ case 13:
+ YY_RULE_SETUP
+ #line 95 "ruby_scanner.ll"
+ { generate_preproc( yytext ) ; }
+ YY_BREAK
+ case 14:
+ YY_RULE_SETUP
+ #line 96 "ruby_scanner.ll"
+ { generate_preproc( yytext ) ; }
+ YY_BREAK
+ case 15:
+ YY_RULE_SETUP
+ #line 97 "ruby_scanner.ll"
+ { BEGIN INITIAL ; endString( yytext ) ; }
+ YY_BREAK
+ case 16:
+ YY_RULE_SETUP
+ #line 99 "ruby_scanner.ll"
+ { generatePreProc( yytext) ; }
+ YY_BREAK
+ case 17:
+ YY_RULE_SETUP
+ #line 101 "ruby_scanner.ll"
+ { generateKeyWord( yytext ) ; }
+ YY_BREAK
+ case 18:
+ YY_RULE_SETUP
+ #line 102 "ruby_scanner.ll"
+ { generateBaseType( yytext ) ; }
+ YY_BREAK
+ case 19:
+ YY_RULE_SETUP
+ #line 103 "ruby_scanner.ll"
+ { generateSymbol( yytext ); }
+ YY_BREAK
+ case 20:
+ YY_RULE_SETUP
+ #line 104 "ruby_scanner.ll"
+ { generateCBracket ( yytext ); }
+ YY_BREAK
+ case 21:
+ YY_RULE_SETUP
+ #line 106 "ruby_scanner.ll"
+ { generateKeyWord( yytext ) ; }
+ YY_BREAK
+ case 22:
+ YY_RULE_SETUP
+ #line 107 "ruby_scanner.ll"
+ { generateBaseType( yytext ) ; }
+ YY_BREAK
+ case 23:
+ YY_RULE_SETUP
+ #line 108 "ruby_scanner.ll"
+ { generateFunction ( yytext ); }
+ YY_BREAK
+ case 24:
+ YY_RULE_SETUP
+ #line 110 "ruby_scanner.ll"
+ { generateNumber( yytext ) ; }
+ YY_BREAK
+ case 25:
+ YY_RULE_SETUP
+ #line 111 "ruby_scanner.ll"
+ { generateNumber( yytext ) ; }
+ YY_BREAK
+ case 26:
+ YY_RULE_SETUP
+ #line 113 "ruby_scanner.ll"
+ { generateString (yytext); }
+ YY_BREAK
+ case 27:
+ YY_RULE_SETUP
+ #line 115 "ruby_scanner.ll"
+ { generate_normal( yytext ) ; }
+ YY_BREAK
+ case 28:
+ YY_RULE_SETUP
+ #line 117 "ruby_scanner.ll"
+ {
+ generateTab() ;
+ }
+ YY_BREAK
+ case 29:
+ YY_RULE_SETUP
+ #line 121 "ruby_scanner.ll"
+ { generate_preproc( yytext ) ; /* anything else */ }
+ YY_BREAK
+ case 30:
+ YY_RULE_SETUP
+ #line 123 "ruby_scanner.ll"
+ {
+ ++lineno;
+ generateNewLine() ;
+ }
+ YY_BREAK
+ case 31:
+ YY_RULE_SETUP
+ #line 128 "ruby_scanner.ll"
+ ECHO;
+ YY_BREAK
+ #line 1279 "ruby_scanner.cc"
+ case YY_STATE_EOF(INITIAL):
+ case YY_STATE_EOF(COMMENT_STATE):
+ case YY_STATE_EOF(SINGLELINE_COMMENT):
+ case YY_STATE_EOF(STRING_STATE):
+ case YY_STATE_EOF(CHAR_STATE):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between yy_current_buffer and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yy_current_buffer->yy_input_file = yyin;
+ yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yy_c_buf_p;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yy_did_buffer_switch_on_eof = 0;
+
+ if ( yywrap() )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p =
+ yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yy_c_buf_p =
+ &yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+ } /* end of yylex */
+
+
+ /* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+
+ static int yy_get_next_buffer()
+ {
+ register char *dest = yy_current_buffer->yy_ch_buf;
+ register char *source = yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( yy_current_buffer->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+ #ifdef YY_USES_REJECT
+ YY_FATAL_ERROR(
+ "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+ #else
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = yy_current_buffer;
+
+ int yy_c_buf_p_offset =
+ (int) (yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yy_flex_realloc( (void *) b->yy_ch_buf,
+ b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = yy_current_buffer->yy_buf_size -
+ number_to_move - 1;
+ #endif
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+ yy_n_chars, num_to_read );
+
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ if ( yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart( yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ yy_current_buffer->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ yy_n_chars += number_to_move;
+ yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+ return ret_val;
+ }
+
+
+ /* yy_get_previous_state - get the state just before the EOB char was reached */
+
+ static yy_state_type yy_get_previous_state()
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = yy_start;
+ yy_current_state += YY_AT_BOL();
+ yy_state_ptr = yy_state_buf;
+ *yy_state_ptr++ = yy_current_state;
+
+ for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 56);
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 200 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ *yy_state_ptr++ = yy_current_state;
+ }
+
+ return yy_current_state;
+ }
+
+
+ /* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+
+ #ifdef YY_USE_PROTOS
+ static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+ #else
+ static yy_state_type yy_try_NUL_trans( yy_current_state )
+ yy_state_type yy_current_state;
+ #endif
+ {
+ register int yy_is_jam;
+
+ register YY_CHAR yy_c = 56;
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 200 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 199);
+ if ( ! yy_is_jam )
+ *yy_state_ptr++ = yy_current_state;
+
+ return yy_is_jam ? 0 : yy_current_state;
+ }
+
+
+ #ifndef YY_NO_UNPUT
+ #ifdef YY_USE_PROTOS
+ static void yyunput( int c, register char *yy_bp )
+ #else
+ static void yyunput( c, yy_bp )
+ int c;
+ register char *yy_bp;
+ #endif
+ {
+ register char *yy_cp = yy_c_buf_p;
+
+ /* undo effects of setting up yytext */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = yy_n_chars + 2;
+ register char *dest = &yy_current_buffer->yy_ch_buf[
+ yy_current_buffer->yy_buf_size + 2];
+ register char *source =
+ &yy_current_buffer->yy_ch_buf[number_to_move];
+
+ while ( source > yy_current_buffer->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ yy_current_buffer->yy_n_chars =
+ yy_n_chars = yy_current_buffer->yy_buf_size;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+ if ( c == '\n' )
+ --yylineno;
+
+ yytext_ptr = yy_bp;
+ yy_hold_char = *yy_cp;
+ yy_c_buf_p = yy_cp;
+ }
+ #endif /* ifndef YY_NO_UNPUT */
+
+
+ #ifdef __cplusplus
+ static int yyinput()
+ #else
+ static int input()
+ #endif
+ {
+ int c;
+
+ *yy_c_buf_p = yy_hold_char;
+
+ if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ /* This was really a NUL. */
+ *yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = yy_c_buf_p - yytext_ptr;
+ ++yy_c_buf_p;
+
+ switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yyrestart( yyin );
+
+ /* fall through */
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap() )
+ return EOF;
+
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ #ifdef __cplusplus
+ return yyinput();
+ #else
+ return input();
+ #endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p = yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
+ *yy_c_buf_p = '\0'; /* preserve yytext */
+ yy_hold_char = *++yy_c_buf_p;
+
+ yy_current_buffer->yy_at_bol = (c == '\n');
+ if ( yy_current_buffer->yy_at_bol )
+ ++yylineno;
+
+ return c;
+ }
+
+
+ #ifdef YY_USE_PROTOS
+ void yyrestart( FILE *input_file )
+ #else
+ void yyrestart( input_file )
+ FILE *input_file;
+ #endif
+ {
+ if ( ! yy_current_buffer )
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_init_buffer( yy_current_buffer, input_file );
+ yy_load_buffer_state();
+ }
+
+
+ #ifdef YY_USE_PROTOS
+ void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+ #else
+ void yy_switch_to_buffer( new_buffer )
+ YY_BUFFER_STATE new_buffer;
+ #endif
+ {
+ if ( yy_current_buffer == new_buffer )
+ return;
+
+ if ( yy_current_buffer )
+ {
+ /* Flush out information for old buffer. */
+ *yy_c_buf_p = yy_hold_char;
+ yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ yy_current_buffer = new_buffer;
+ yy_load_buffer_state();
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yy_did_buffer_switch_on_eof = 1;
+ }
+
+
+ #ifdef YY_USE_PROTOS
+ void yy_load_buffer_state( void )
+ #else
+ void yy_load_buffer_state()
+ #endif
+ {
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+ yyin = yy_current_buffer->yy_input_file;
+ yy_hold_char = *yy_c_buf_p;
+ }
+
+
+ #ifdef YY_USE_PROTOS
+ YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+ #else
+ YY_BUFFER_STATE yy_create_buffer( file, size )
+ FILE *file;
+ int size;
+ #endif
+ {
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer( b, file );
+
+ return b;
+ }
+
+
+ #ifdef YY_USE_PROTOS
+ void yy_delete_buffer( YY_BUFFER_STATE b )
+ #else
+ void yy_delete_buffer( b )
+ YY_BUFFER_STATE b;
+ #endif
+ {
+ if ( ! b )
+ return;
+
+ if ( b == yy_current_buffer )
+ yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yy_flex_free( (void *) b->yy_ch_buf );
+
+ yy_flex_free( (void *) b );
+ }
+
+
+ #ifndef YY_ALWAYS_INTERACTIVE
+ #ifndef YY_NEVER_INTERACTIVE
+ extern int isatty YY_PROTO(( int ));
+ #endif
+ #endif
+
+ #ifdef YY_USE_PROTOS
+ void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+ #else
+ void yy_init_buffer( b, file )
+ YY_BUFFER_STATE b;
+ FILE *file;
+ #endif
+
+
+ {
+ yy_flush_buffer( b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+ #if YY_ALWAYS_INTERACTIVE
+ b->yy_is_interactive = 1;
+ #else
+ #if YY_NEVER_INTERACTIVE
+ b->yy_is_interactive = 0;
+ #else
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+ #endif
+ #endif
+ }
+
+
+ #ifdef YY_USE_PROTOS
+ void yy_flush_buffer( YY_BUFFER_STATE b )
+ #else
+ void yy_flush_buffer( b )
+ YY_BUFFER_STATE b;
+ #endif
+
+ {
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == yy_current_buffer )
+ yy_load_buffer_state();
+ }
+
+
+ #ifndef YY_NO_SCAN_BUFFER
+ #ifdef YY_USE_PROTOS
+ YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+ #else
+ YY_BUFFER_STATE yy_scan_buffer( base, size )
+ char *base;
+ yy_size_t size;
+ #endif
+ {
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer( b );
+
+ return b;
+ }
+ #endif
+
+
+ #ifndef YY_NO_SCAN_STRING
+ #ifdef YY_USE_PROTOS
+ YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+ #else
+ YY_BUFFER_STATE yy_scan_string( yy_str )
+ yyconst char *yy_str;
+ #endif
+ {
+ int len;
+ for ( len = 0; yy_str[len]; ++len )
+ ;
+
+ return yy_scan_bytes( yy_str, len );
+ }
+ #endif
+
+
+ #ifndef YY_NO_SCAN_BYTES
+ #ifdef YY_USE_PROTOS
+ YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+ #else
+ YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+ yyconst char *bytes;
+ int len;
+ #endif
+ {
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yy_flex_alloc( n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer( buf, n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+ }
+ #endif
+
+
+ #ifndef YY_NO_PUSH_STATE
+ #ifdef YY_USE_PROTOS
+ static void yy_push_state( int new_state )
+ #else
+ static void yy_push_state( new_state )
+ int new_state;
+ #endif
+ {
+ if ( yy_start_stack_ptr >= yy_start_stack_depth )
+ {
+ yy_size_t new_size;
+
+ yy_start_stack_depth += YY_START_STACK_INCR;
+ new_size = yy_start_stack_depth * sizeof( int );
+
+ if ( ! yy_start_stack )
+ yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+ else
+ yy_start_stack = (int *) yy_flex_realloc(
+ (void *) yy_start_stack, new_size );
+
+ if ( ! yy_start_stack )
+ YY_FATAL_ERROR(
+ "out of memory expanding start-condition stack" );
+ }
+
+ yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+ BEGIN(new_state);
+ }
+ #endif
+
+
+ #ifndef YY_NO_POP_STATE
+ static void yy_pop_state()
+ {
+ if ( --yy_start_stack_ptr < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN(yy_start_stack[yy_start_stack_ptr]);
+ }
+ #endif
+
+
+ #ifndef YY_NO_TOP_STATE
+ static int yy_top_state()
+ {
+ return yy_start_stack[yy_start_stack_ptr - 1];
+ }
+ #endif
+
+ #ifndef YY_EXIT_FAILURE
+ #define YY_EXIT_FAILURE 2
+ #endif
+
+ #ifdef YY_USE_PROTOS
+ static void yy_fatal_error( yyconst char msg[] )
+ #else
+ static void yy_fatal_error( msg )
+ char msg[];
+ #endif
+ {
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+ }
+
+
+
+ /* Redefine yyless() so it works in section 3 code. */
+
+ #undef yyless
+ #define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ yytext[yyleng] = yy_hold_char; \
+ yy_c_buf_p = yytext + n; \
+ yy_hold_char = *yy_c_buf_p; \
+ *yy_c_buf_p = '\0'; \
+ yyleng = n; \
+ } \
+ while ( 0 )
+
+
+ /* Internal utility routines. */
+
+ #ifndef yytext_ptr
+ #ifdef YY_USE_PROTOS
+ static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+ #else
+ static void yy_flex_strncpy( s1, s2, n )
+ char *s1;
+ yyconst char *s2;
+ int n;
+ #endif
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+ }
+ #endif
+
+ #ifdef YY_NEED_STRLEN
+ #ifdef YY_USE_PROTOS
+ static int yy_flex_strlen( yyconst char *s )
+ #else
+ static int yy_flex_strlen( s )
+ yyconst char *s;
+ #endif
+ {
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+ }
+ #endif
+
+
+ #ifdef YY_USE_PROTOS
+ static void *yy_flex_alloc( yy_size_t size )
+ #else
+ static void *yy_flex_alloc( size )
+ yy_size_t size;
+ #endif
+ {
+ return (void *) malloc( size );
+ }
+
+ #ifdef YY_USE_PROTOS
+ static void *yy_flex_realloc( void *ptr, yy_size_t size )
+ #else
+ static void *yy_flex_realloc( ptr, size )
+ void *ptr;
+ yy_size_t size;
+ #endif
+ {
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+ }
+
+ #ifdef YY_USE_PROTOS
+ static void yy_flex_free( void *ptr )
+ #else
+ static void yy_flex_free( ptr )
+ void *ptr;
+ #endif
+ {
+ free( ptr );
+ }
+
+ #if YY_MAIN
+ int main()
+ {
+ yylex();
+ return 0;
+ }
+ #endif
+ #line 128 "ruby_scanner.ll"
+
+ /*
+ void yyerror( char *s ) ;
+
+ void yyerror( char *s )
+ {
+ fprintf( stderr, "%d: %s: %s\n%s\n", lineno, s, yytext, linebuf ) ;
+ fprintf( stderr, "%*s\n", tokenpos, "^" ) ;
+ }
+ */
+ /* vim:set ft=flex expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */
diff -crN source-highlight-1.6.3.org/src/ruby_scanner.ll source-highlight-1.6.3/src/ruby_scanner.ll
*** source-highlight-1.6.3.org/src/ruby_scanner.ll Thu Jan 1 09:00:00 1970
--- source-highlight-1.6.3/src/ruby_scanner.ll Mon Feb 10 00:51:09 2003
***************
*** 0 ****
--- 1,138 ----
+ %{
+ /*
+ * Copyright (C) 2003 Noritsugu Nakamura
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+ /*
+ Scanner for ruby, version 0.0.0
+ Written by Noritsugu Nakamura
+ */
+
+ static int lineno = 1 ; /* number of scanned lines */
+ //char linebuf[1024] ; /* current code line in the source */
+ //int tokenpos = 0 ; /* current token position in the current line */
+
+ //#include "tags.h"
+ //#include "tokens.h"
+ //#include "colors.h"
+
+ #include "genfun.h"
+
+ %}
+ %option prefix="ruby_scanner_"
+ %option noyywrap
+
+
+ nl \n
+ cr \r
+ STRING \"[^\"\n]*\"
+ not_alpha [^a-zA-Z0-9]
+
+ %s COMMENT_STATE
+ %s SINGLELINE_COMMENT
+ %s STRING_STATE
+ %s CHAR_STATE
+
+ IDE [a-zA-Z_]([a-zA-Z0-9_])*
+ wspace [ \t\n\r]
+
+
+ keyword1 (alias|begin|BEGIN|break|case|defined?|do|else|elsif|end|END|ensure|for|if|in|loop|next|raise|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield)
+ keyword2 (false|nil|self|true|__FILE__|__LINE__)
+ keyword3 (and|not|or)
+ keyword4 (def|class|module)
+ keyword5 (catch|fail|include|load|require|throw)
+
+ keyword ({keyword1}|{keyword2}|{keyword3}|{keyword4}|{keyword5})
+ basetype (\0)
+ symbol [\~\!\%\^\*\(\)\-\+\=\[\]\|\\\:\;\,\.\/\?\&\<\>\{\}]
+ cbracket [\0]
+
+ funccall {IDE}/{wspace}*{wspace}*\(
+
+ %%
+
+ "#" { BEGIN SINGLELINE_COMMENT ; startComment( yytext ) ; }
+ \n {
+ BEGIN INITIAL ;
+ yyless (0); // put the \n back
+ endComment( yytext ) ;
+ /* if we encounter another # during a comment we simply
+ treat it as a ordinary string */
+ }
+ ^"=begin" { BEGIN COMMENT_STATE ;
+ startComment( yytext ) ;
+ }
+ ^"=end" { endComment(yytext) ;
+ BEGIN INITIAL ; /* end of rd doc */ }
+
+
+ "$\"" { generate_normal( yytext ); }
+ "$\'" { generate_normal( yytext ); }
+ "\\\"" { generate_normal( yytext ); }
+
+ \" { BEGIN STRING_STATE ; startString( yytext ); }
+ \\\\ { generate_preproc( yytext ) ; }
+ "\\\"" { generate_preproc( yytext ) ; }
+ \" { BEGIN INITIAL ; endString( yytext ) ; }
+
+ \' { BEGIN CHAR_STATE ; startString( yytext ); }
+ \\\\ { generate_preproc( yytext ) ; }
+ "\\\'" { generate_preproc( yytext ) ; }
+ \' { BEGIN INITIAL ; endString( yytext ) ; }
+
+ [\0] { generatePreProc( yytext) ; }
+
+ {keyword} { generateKeyWord( yytext ) ; }
+ {basetype} { generateBaseType( yytext ) ; }
+ {symbol} { generateSymbol( yytext ); }
+ [\{\}] { generateCBracket ( yytext ); }
+
+ {keyword}/{wspace}*\( { generateKeyWord( yytext ) ; }
+ {basetype}/{wspace}*\( { generateBaseType( yytext ) ; }
+ {funccall} { generateFunction ( yytext ); }
+
+ 0[xX][0-9a-fA-F]* { generateNumber( yytext ) ; }
+ [0-9][0-9]*(\.[0-9]*[eE]?[-+]?[0-9]*)? { generateNumber( yytext ) ; }
+
+ \<[^\"\n ]*\> { generateString (yytext); }
+
+ [a-zA-Z_]([a-zA-Z0-9_])* { generate_normal( yytext ) ; }
+
+ \t {
+ generateTab() ;
+ }
+
+ . { generate_preproc( yytext ) ; /* anything else */ }
+
+ \n {
+ ++lineno;
+ generateNewLine() ;
+ }
+
+ %%
+ /*
+ void yyerror( char *s ) ;
+
+ void yyerror( char *s )
+ {
+ fprintf( stderr, "%d: %s: %s\n%s\n", lineno, s, yytext, linebuf ) ;
+ fprintf( stderr, "%*s\n", tokenpos, "^" ) ;
+ }
+ */
+ /* vim:set ft=flex expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */