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