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