X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FParser%2FSybase.pm;h=bf48b55c54f6185f1f85a3b29afee43c6e0b5a5c;hb=60f751e48ef6109258005ff4f67539a976c825b5;hp=287762ff776af4ad4c474593744700adafd5a48d;hpb=70dfd7c41f865d49e6faa374cb13728c101d6f91;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Parser/Sybase.pm b/lib/SQL/Translator/Parser/Sybase.pm index 287762f..bf48b55 100644 --- a/lib/SQL/Translator/Parser/Sybase.pm +++ b/lib/SQL/Translator/Parser/Sybase.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::Sybase; # ------------------------------------------------------------------- -# $Id: Sybase.pm,v 1.6 2003-08-21 02:39:21 kycl4rk Exp $ +# $Id: Sybase.pm,v 1.8 2003-11-05 23:27:09 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark , # darren chamberlain , @@ -32,15 +32,17 @@ SQL::Translator::Parser::Sybase - parser for Sybase =head1 DESCRIPTION -Parses the output of "dbschema.pl," a Perl script freely available from -www.midsomer.org. +Mostly parses the output of "dbschema.pl," a Perl script freely +available from http://www.midsomer.org. The parsing is not complete, +however, and you would probably have much better luck using the +DBI-Sybase parser included with SQL::Translator. =cut use strict; use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -50,15 +52,14 @@ use base qw(Exporter); @EXPORT_OK = qw(parse); -# Enable warnings within the Parse::RecDescent module. -$::RD_ERRORS = 1; # Make sure the parser dies when it encounters an error -$::RD_WARN = 1; # Enable warnings. This will warn on unused rules &c. -$::RD_HINT = 1; # Give out hints to help fix problems. +$::RD_ERRORS = 1; +$::RD_WARN = 1; +$::RD_HINT = 1; $GRAMMAR = q{ { - my ( %tables, @table_comments ); + my ( %tables, @table_comments, $table_order ); } startrule : statement(s) eofile { \%tables } @@ -132,6 +133,7 @@ create_table : /create/i /table/i ident '(' create_def(s /,/) ')' lock(?) on_sys @table_comments = (); } + $tables{ $table_name }{'order'} = ++$table_order; $tables{ $table_name }{'name'} = $table_name; $tables{ $table_name }{'owner'} = $table_owner; $tables{ $table_name }{'system'} = $item[7]; @@ -422,6 +424,6 @@ Ken Y. Clark Ekclark@cpan.orgE. =head1 SEE ALSO -perl(1). +SQL::Translator, SQL::Translator::Parser::DBI, L. =cut