1 package SQL::Translator::Parser;
5 use vars qw( $VERSION );
12 # ----------------------------------------------------------------------
13 # Enough! or Too much.
15 # ----------------------------------------------------------------------
21 SQL::Translator::Parser - describes how to write a parser
25 Parser modules that get invoked by SQL::Translator need to implement a
26 single function: B<parse>. This function will be called by the
27 SQL::Translator instance as $class::parse($tr, $data_as_string), where
28 $tr is a SQL::Translator instance. Other than that, the classes are
29 free to define any helper functions, or use any design pattern
30 internally that make the most sense.
32 When the parser has determined what exists, it will communicate the
33 structure to the producer through the SQL::Translator::Schema object.
34 This object can be retrieved from the translator (the first argument
35 pass to B<parse>) by calling the B<schema> method:
37 my $schema = $tr->schema;
39 The Schema object has methods for adding tables, fields, indices, etc.
40 For more information, consult the docs for SQL::Translator::Schema and
41 its related modules. For examples of how this works, examine the
42 source code for existing SQL::Translator::Parser::* modules.
46 Ken Youens-Clark, E<lt>kclark@cpan.org<gt>,
47 darren chamberlain E<lt>darren@cpan.orgE<gt>.
51 perl(1), SQL::Translator, SQL::Translator::Schema.