Strip evil svn:keywords
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Parser.pm
index 5e7cda9..5c4fc09 100644 (file)
@@ -1,10 +1,9 @@
 package SQL::Translator::Parser;
 
 # ----------------------------------------------------------------------
-# $Id: Parser.pm,v 1.1.1.1.2.1 2002-03-15 20:13:46 dlc Exp $
+# $Id: Parser.pm 1440 2009-01-17 16:31:57Z jawnsy $
 # ----------------------------------------------------------------------
-# Copyright (C) 2002 Ken Y. Clark <kycl4rk@users.sourceforge.net>,
-#                    darren chamberlain <darren@cpan.org>
+# Copyright (C) 2002-2009 SQLFairy Authors
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -22,36 +21,50 @@ package SQL::Translator::Parser;
 # ----------------------------------------------------------------------
 
 use strict;
-use vars qw( $VERSION );
-$VERSION = sprintf "%d.%02d", q$Revision: 1.1.1.1.2.1 $ =~ /(\d+)\.(\d+)/;
 
 sub parse { "" }
 
 1;
 
-#-----------------------------------------------------
+# ----------------------------------------------------------------------
 # Enough! or Too much.
 # William Blake
-#-----------------------------------------------------
+# ----------------------------------------------------------------------
+
+=pod
 
 =head1 NAME
 
-SQL::Translator::Parser - base object for parsers
+SQL::Translator::Parser - describes how to write a parser
 
 =head1 DESCRIPTION
 
-Parser modules that get invoked by SQL::Translator need to implement
-a single function: B<parse>.  This function will be called by the
-SQL::Translator instance as $class::parse($data_as_string).  Other
-than that, the classes are free to define any helper functions, or
-use any design pattern internally that make the most sense.
+Parser modules that get invoked by SQL::Translator need to implement a
+single function: B<parse>.  This function will be called by the
+SQL::Translator instance as $class::parse($tr, $data_as_string), where
+$tr is a SQL::Translator instance.  Other than that, the classes are
+free to define any helper functions, or use any design pattern
+internally that make the most sense.
+
+When the parser has determined what exists, it will communicate the
+structure to the producer through the SQL::Translator::Schema object.
+This object can be retrieved from the translator (the first argument
+pass to B<parse>) by calling the B<schema> method:
+
+  my $schema = $tr->schema;
+
+The Schema object has methods for adding tables, fields, indices, etc.
+For more information, consult the docs for SQL::Translator::Schema and
+its related modules.  For examples of how this works, examine the
+source code for existing SQL::Translator::Parser::* modules.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Ken Y. Clark, kclark@logsoft.com
+Ken Y. Clark, E<lt>kclark@cpan.org<gt>, 
+darren chamberlain E<lt>darren@cpan.orgE<gt>.
 
 =head1 SEE ALSO
 
-perl(1).
+perl(1), SQL::Translator, SQL::Translator::Schema.
 
 =cut