- Removed use of $Revision$ SVN keyword to generate VERSION variables; now sub-module...
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Parser.pm
1 package SQL::Translator::Parser;
2
3 # ----------------------------------------------------------------------
4 # $Id$
5 # ----------------------------------------------------------------------
6 # Copyright (C) 2002-2009 SQLFairy Authors
7 #
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; version 2.
11 #
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 # 02111-1307  USA
21 # ----------------------------------------------------------------------
22
23 use strict;
24
25 sub parse { "" }
26
27 1;
28
29 # ----------------------------------------------------------------------
30 # Enough! or Too much.
31 # William Blake
32 # ----------------------------------------------------------------------
33
34 =pod
35
36 =head1 NAME
37
38 SQL::Translator::Parser - describes how to write a parser
39
40 =head1 DESCRIPTION
41
42 Parser modules that get invoked by SQL::Translator need to implement a
43 single function: B<parse>.  This function will be called by the
44 SQL::Translator instance as $class::parse($tr, $data_as_string), where
45 $tr is a SQL::Translator instance.  Other than that, the classes are
46 free to define any helper functions, or use any design pattern
47 internally that make the most sense.
48
49 When the parser has determined what exists, it will communicate the
50 structure to the producer through the SQL::Translator::Schema object.
51 This object can be retrieved from the translator (the first argument
52 pass to B<parse>) by calling the B<schema> method:
53
54   my $schema = $tr->schema;
55
56 The Schema object has methods for adding tables, fields, indices, etc.
57 For more information, consult the docs for SQL::Translator::Schema and
58 its related modules.  For examples of how this works, examine the
59 source code for existing SQL::Translator::Parser::* modules.
60
61 =head1 AUTHORS
62
63 Ken Y. Clark, E<lt>kclark@cpan.org<gt>, 
64 darren chamberlain E<lt>darren@cpan.orgE<gt>.
65
66 =head1 SEE ALSO
67
68 perl(1), SQL::Translator, SQL::Translator::Schema.
69
70 =cut