f6bcc6daef19637aca675a8fa787b27f98c2c2ca
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Parser.pm
1 package SQL::Translator::Parser;
2
3 use strict;
4 use vars qw( $VERSION );
5 $VERSION = '1.60';
6
7 sub parse { "" }
8
9 1;
10
11 # ----------------------------------------------------------------------
12 # Enough! or Too much.
13 # William Blake
14 # ----------------------------------------------------------------------
15
16 =pod
17
18 =head1 NAME
19
20 SQL::Translator::Parser - describes how to write a parser
21
22 =head1 DESCRIPTION
23
24 Parser modules that get invoked by SQL::Translator need to implement a
25 single function: B<parse>.  This function will be called by the
26 SQL::Translator instance as $class::parse($tr, $data_as_string), where
27 $tr is a SQL::Translator instance.  Other than that, the classes are
28 free to define any helper functions, or use any design pattern
29 internally that make the most sense.
30
31 When the parser has determined what exists, it will communicate the
32 structure to the producer through the SQL::Translator::Schema object.
33 This object can be retrieved from the translator (the first argument
34 pass to B<parse>) by calling the B<schema> method:
35
36   my $schema = $tr->schema;
37
38 The Schema object has methods for adding tables, fields, indices, etc.
39 For more information, consult the docs for SQL::Translator::Schema and
40 its related modules.  For examples of how this works, examine the
41 source code for existing SQL::Translator::Parser::* modules.
42
43 =head1 AUTHORS
44
45 Ken Youens-Clark, E<lt>kclark@cpan.org<gt>,
46 darren chamberlain E<lt>darren@cpan.orgE<gt>.
47
48 =head1 SEE ALSO
49
50 perl(1), SQL::Translator, SQL::Translator::Schema.
51
52 =cut