SQL-Translator-1.66/0000755000000000000000000000000014716630506014242 5ustar00rootroot00000000000000SQL-Translator-1.66/script/0000755000000000000000000000000014716630506015546 5ustar00rootroot00000000000000SQL-Translator-1.66/script/sqlt-graph0000755000000000000000000001761414716630117017565 0ustar00rootroot00000000000000#!perl # ------------------------------------------------------------------- # Copyright (C) 2002-2009 SQLFairy Authors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; version 2. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. # ------------------------------------------------------------------- =head1 NAME sqlt-graph - Automatically create a graph from a database schema =head1 SYNOPSIS ./sqlt-graph -d|--db|-f|--from=db_parser [options] schema.sql Options: -l|--layout Layout schema for GraphViz ("dot," "neato," "twopi"; default "dot") -n|--node-shape Shape of the nodes ("record," "plaintext," "ellipse," "circle," "egg," "triangle," "box," "diamond," "trapezium," "parallelogram," "house," "hexagon," "octagon," default "record") -o|--output Output file name (default STDOUT) -t|--output-type Output file type ("canon", "text," "ps," "hpgl," "pcl," "mif," "pic," "gd," "gd2," "gif," "jpeg," "png," "wbmp," "cmap," "ismap," "imap," "vrml," "vtx," "mp," "fig," "svg," "plain," default "png") -c|--color Add colors --cluster Cluster tables --no-fields Don't show field names --height Image height (in inches, default "11", set to "0" to undefine) --width Image width (in inches, default "8.5", set to "0" to undefine) --fontsize custom font size for node and edge labels --fontname name of custom font (or full path to font file) for node, edge, and graph labels --nodeattr attribute name and value (in key=val syntax) for nodes; this option may be repeated to specify multiple node attributes --edgeattr same as --nodeattr, but for edge attributes --graphattr same as --nodeattr, but for graph attributes --natural-join Perform natural joins --natural-join-pk Perform natural joins from primary keys only --show-datatypes Show datatype of each field --show-sizes Show column sizes for VARCHAR and CHAR fields --show-constraints Show list of constraints for each field -s|--skip Fields to skip in natural joins --skip-tables Comma-separated list of table names to exclude --skip-tables-like Comma-separated list of regexen to exclude tables --debug Print debugging information --trace Print parser trace info =head1 DESCRIPTION This script will create a graph of your schema. Only the database driver argument (for SQL::Translator) is required. If no output file name is given, then image will be printed to STDOUT, so you should redirect the output into a file. The default action is to assume the presence of foreign key relationships defined via "REFERNCES" or "FOREIGN KEY" constraints on the tables. If you are parsing the schema of a file that does not have these, you will find the natural join options helpful. With natural joins, like-named fields will be considered foreign keys. This can prove too permissive, however, as you probably don't want a field called "name" to be considered a foreign key, so you could include it in the "skip" option, and all fields called "name" will be excluded from natural joins. A more efficient method, however, might be to simply deduce the foreign keys from primary keys to other fields named the same in other tables. Use the "natural-join-pk" option to achieve this. If the schema defines foreign keys, then the graph produced will be directed showing the direction of the relationship. If the foreign keys are intuited via natural joins, the graph will be undirected. Clustering of tables allows you to group and box tables according to function or domain or whatever criteria you choose. The syntax for clustering tables is: cluster1=table1,table2;cluster2=table3,table4 =cut # ------------------------------------------------------------------- use strict; use warnings; use Data::Dumper; use Getopt::Long; use GraphViz; use Pod::Usage; use SQL::Translator; use vars '$VERSION'; $VERSION = '1.66'; # # Get arguments. # my ( $layout, $node_shape, $out_file, $output_type, $db_driver, $add_color, $natural_join, $join_pk_only, $skip_fields, $show_datatypes, $show_sizes, $show_constraints, $debug, $help, $height, $width, $no_fields, $fontsize, $fontname, $skip_tables, $skip_tables_like, $cluster, $trace ); # multi-valued options: my %edgeattrs = (); my %nodeattrs = (); my %graphattrs = (); GetOptions( 'd|db|f|from=s' => \$db_driver, 'o|output:s' => \$out_file, 'l|layout:s' => \$layout, 'n|node-shape:s' => \$node_shape, 't|output-type:s' => \$output_type, 'height:f' => \$height, 'width:f' => \$width, 'fontsize=i' => \$fontsize, 'fontname=s' => \$fontname, 'nodeattr=s' => \%nodeattrs, 'edgeattr=s' => \%edgeattrs, 'graphattr=s' => \%graphattrs, 'c|color' => \$add_color, 'cluster:s' => \$cluster, 'no-fields' => \$no_fields, 'natural-join' => \$natural_join, 'natural-join-pk' => \$join_pk_only, 's|skip:s' => \$skip_fields, 'skip-tables:s' => \$skip_tables, 'skip-tables-like:s' => \$skip_tables_like, 'show-datatypes' => \$show_datatypes, 'show-sizes' => \$show_sizes, 'show-constraints' => \$show_constraints, 'debug' => \$debug, 'trace' => \$trace, 'h|help' => \$help, ) or die pod2usage; my @files = @ARGV; # the create script(s) for the original db pod2usage(1) if $help; pod2usage(-message => "No db driver specified") unless $db_driver; pod2usage(-message => 'No input file') unless @files; my $translator = SQL::Translator->new( from => $db_driver, to => 'GraphViz', debug => $debug || 0, trace => $trace || 0, producer_args => { out_file => $out_file, layout => $layout, node_shape => $node_shape, output_type => $output_type, add_color => $add_color, natural_join => $natural_join, natural_join_pk => $join_pk_only, skip_fields => $skip_fields, skip_tables => $skip_tables, skip_tables_like => $skip_tables_like, show_datatypes => $show_datatypes, show_sizes => $show_sizes, show_constraints => $show_constraints, cluster => $cluster, height => $height || 0, width => $width || 0, fontsize => $fontsize, fontname => $fontname, nodeattrs => \%nodeattrs, edgeattrs => \%edgeattrs, graphattrs => \%graphattrs, show_fields => $no_fields ? 0 : 1, }, ) or die SQL::Translator->error; for my $file (@files) { my $output = $translator->translate($file) or die "Error: " . $translator->error; if ($out_file) { print "Image written to '$out_file'. Done.\n"; } else { print $output; } } # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =head1 SEE ALSO perl, SQL::Translator. =cut SQL-Translator-1.66/script/sqlt-diff0000755000000000000000000001511314716630117017364 0ustar00rootroot00000000000000#!perl # vim: set ft=perl: # ------------------------------------------------------------------- # Copyright (C) 2002-2009 The SQLFairy Authors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; version 2. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MAb # 02110-1301 USA. # ------------------------------------------------------------------- =head1 NAME sqlt-diff - find the differences b/w two schemas =head1 SYNOPSIS For help: sqlt-diff -h|--help For a list of all valid parsers: sqlt -l|--list To diff two schemas: sqlt-diff [options] file_name1=parser1 file_name2=parser2 Options: -d|--debug Show debugging info -t|--trace Turn on tracing for Parse::RecDescent -c|--case-insensitive Compare tables/columns case-insensitively --ignore-index-names Ignore index name differences --ignore-constraint-names Ignore constraint name differences --mysql_parser_version=<#####> Specify a target MySQL parser version for dealing with /*! comments --output-db= This Producer will be used instead of one corresponding to parser1 to format output for new tables --ignore-view-sql Ignore view SQL differences --ignore-proc-sql Ignore procedure SQL differences --no-batch-alters Do not clump multile alters to the same table into a single ALTER TABLE statement where possible. --quote= Use to quote all table and field names in statements =head1 DESCRIPTION sqlt-diff is a utility for creating a file of SQL commands necessary to transform the first schema provided to the second. While not yet exhaustive in its ability to mutate the entire schema, it will report the following =over =item * New tables Using the Producer class of the target (second) schema, any tables missing in the first schema will be generated in their entirety (fields, constraints, indices). =item * Missing/altered fields Any fields missing or altered between the two schemas will be reported as: ALTER TABLE [DROP ] [CHANGE ()] ; =item * Missing/altered indices Any indices missing or of a different type or on different fields will be indicated. Indices that should be dropped will be reported as such: DROP INDEX ON ; An index of a different type or on different fields will be reported as a new index as such: CREATE [] INDEX [] ON ( [,] ) ; =back ALTER, CREATE, DROP statements are created by SQL::Translator::Producer::*, see there for support/problems. Currently (v0.0900), only MySQL is supported by this code. =cut # ------------------------------------------------------------------- use strict; use warnings; use Pod::Usage; use Data::Dumper; use Getopt::Long; use SQL::Translator; use SQL::Translator::Diff; use SQL::Translator::Schema::Constants; use vars qw( $VERSION ); $VERSION = '1.66'; my (@input, $list, $help, $debug, $trace, $caseopt, $ignore_index_names, $ignore_constraint_names, $output_db, $mysql_parser_version, $ignore_view_sql, $ignore_proc_sql, $no_batch_alters, $quote); GetOptions( 'l|list' => \$list, 'h|help' => \$help, 'd|debug' => \$debug, 't|trace' => \$trace, 'c|case-insensitive' => \$caseopt, 'ignore-index-names' => \$ignore_index_names, 'ignore-constraint-names' => \$ignore_constraint_names, 'mysql_parser_version:s' => \$mysql_parser_version, 'output-db:s' => \$output_db, 'ignore-view-sql' => \$ignore_view_sql, 'ignore-proc-sql' => \$ignore_proc_sql, 'quote:s' => \$quote, 'no-batch-alters' => \$no_batch_alters, ) or pod2usage(2); for my $arg (@ARGV) { if ($arg =~ m/^([^=]+)=(.+)$/) { push @input, { file => $1, parser => $2 }; } } my $tr = SQL::Translator->new; my @parsers = $tr->list_parsers; my %valid_parsers = map { $_, 1 } @parsers; if ($list) { print "\nParsers:\n", map {"\t$_\n"} sort @parsers; print "\n"; exit(0); } pod2usage(1) if $help || !@input; pod2usage(msg => 'Please specify two schemas to diff') if scalar @input != 2; my ($source_schema, $source_db, $target_schema, $target_db) = map { my $file = $_->{'file'}; my $parser = $_->{'parser'}; die "Unable to read file '$file'\n" unless -r $file; die "'$parser' is an invalid parser\n" unless $valid_parsers{$parser}; my $t = SQL::Translator->new(parser_args => { mysql_parser_version => $mysql_parser_version }); $t->debug($debug); $t->trace($trace); $t->parser($parser) or die $tr->error; my $out = $t->translate($file) or die $tr->error; my $schema = $t->schema; unless ($schema->name) { $schema->name($file); } ($schema, $parser); } @input; my $result = SQL::Translator::Diff::schema_diff( $source_schema, $source_db, $target_schema, $target_db, { caseopt => $caseopt || 0, ignore_index_names => $ignore_index_names || 0, ignore_constraint_names => $ignore_constraint_names || 0, ignore_view_sql => $ignore_view_sql || 0, ignore_proc_sql => $ignore_proc_sql || 0, output_db => $output_db, no_batch_alters => $no_batch_alters || 0, debug => $debug || 0, trace => $trace || 0, sqlt_args => { quote_table_names => $quote || '', quote_field_names => $quote || '', }, } ); if ($result) { print $result; } else { print "No differences found."; } # ------------------------------------------------------------------- # Bring out number weight & measure in a year of dearth. # William Blake # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =head1 SEE ALSO SQL::Translator, L. =cut SQL-Translator-1.66/script/sqlt-dumper0000755000000000000000000000620014716630117017745 0ustar00rootroot00000000000000#!perl # ------------------------------------------------------------------- # Copyright (C) 2002-2009 SQLFairy Authors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; version 2. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. # # ------------------------------------------------------------------- =head1 NAME sqlt-dumper - create a dumper script from a schema =head1 SYNOPSIS sqlt-dumper -d Oracle [options] schema.sql > dumper.pl ./dumper.pl > data.sql Options: -h|--help Show help and exit --skip=t1[,t2] Skip tables in comma-separated list --skiplike=regex Skip tables matching the regular expression -u|--user Database username -p|--password Database password --dsn DSN for DBI =head1 DESCRIPTION This script uses SQL::Translator to parse the SQL schema and create a Perl script that can connect to the database and dump the data as INSERT statements (a la mysqldump) or MySQL's LOAD FILE syntax. You may specify tables to "skip" (also using a "skiplike" regular expression) and the generated dumper script will not have those tables. However, these will also be options in the generated dumper, so you can wait to specify these options when you dump your database. The database username, password, and DSN can be hardcoded into the generated script, or part of the DSN can be intuited from the "database" argument. =cut # ------------------------------------------------------------------- use strict; use warnings; use Pod::Usage; use Getopt::Long; use SQL::Translator; use File::Basename qw(basename); use vars '$VERSION'; $VERSION = '1.66'; my ($help, $db, $skip, $skiplike, $db_user, $db_pass, $dsn); GetOptions( 'h|help' => \$help, 'd|f|from|db=s' => \$db, 'skip:s' => \$skip, 'skiplike:s' => \$skiplike, 'u|user:s' => \$db_user, 'p|password:s' => \$db_pass, 'dsn:s' => \$dsn, ) or pod2usage; pod2usage(0) if $help; pod2usage('No database driver specified') unless $db; $db_user ||= 'username'; $db_pass ||= 'password'; $dsn ||= "dbi:$db:_"; my $file = shift @ARGV or pod2usage(-msg => 'No input file'); my $t = SQL::Translator->new( from => $db, to => 'Dumper', producer_args => { skip => $skip, skiplike => $skiplike, db_user => $db_user, db_password => $db_pass, dsn => $dsn, } ); print $t->translate($file); exit(0); # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =head1 SEE ALSO perl, SQL::Translator, SQL::Translator::Producer::Dumper. =cut SQL-Translator-1.66/script/sqlt-diff-old0000755000000000000000000004322314716630117020143 0ustar00rootroot00000000000000#!perl # vim: set ft=perl: # ------------------------------------------------------------------- # Copyright (C) 2002-2009 The SQLFairy Authors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; version 2. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. # ------------------------------------------------------------------- =head1 NAME sqlt-diff - find the differences b/w two schemas =head1 SYNOPSIS For help: sqlt-diff -h|--help For a list of all valid parsers: sqlt -l|--list To diff two schemas: sqlt-diff [options] file_name1=parser file_name2=parser Options: -d|--debug Show debugging info =head1 DESCRIPTION sqlt-diff is a utility for creating a file of SQL commands necessary to transform the first schema provided to the second. While not yet exhaustive in its ability to mutate the entire schema, it will report the following =over =item * New tables Using the Producer class of the target (second) schema, any tables missing in the first schema will be generated in their entirety (fields, constraints, indices). =item * Missing/altered fields Any fields missing or altered between the two schemas will be reported as: ALTER TABLE [DROP ] [CHANGE ()] ; =item * Missing/altered indices Any indices missing or of a different type or on different fields will be indicated. Indices that should be dropped will be reported as such: DROP INDEX ON ; An index of a different type or on different fields will be reported as a new index as such: CREATE [] INDEX [] ON ( [,] ) ; =back "ALTER/DROP TABLE" and "CREATE INDEX" statements B generated by the Producer, unfortunately, and may require massaging before being passed to your target database. =cut # ------------------------------------------------------------------- use strict; use warnings; use Pod::Usage; use Data::Dumper; use SQL::Translator; use SQL::Translator::Schema::Constants; use vars qw( $VERSION ); $VERSION = '1.66'; my (@input, $list, $help, $debug); for my $arg (@ARGV) { if ($arg =~ m/^-?-l(ist)?$/) { $list = 1; } elsif ($arg =~ m/^-?-h(elp)?$/) { $help = 1; } elsif ($arg =~ m/^-?-d(ebug)?$/) { $debug = 1; } elsif ($arg =~ m/^([^=]+)=(.+)$/) { push @input, { file => $1, parser => $2 }; } else { pod2usage(msg => "Unknown argument '$arg'"); } } pod2usage(1) if $help; pod2usage('Please specify only two schemas to diff') if scalar @input > 2; pod2usage('No input') if !@input; if (my $interactive = -t STDIN && -t STDOUT) { print STDERR join("\n", "sqlt-diff-old is deprecated. Please sqlt-diff, and tell us ", "about any problems or patch SQL::Translator::Diff", '', ); } my $tr = SQL::Translator->new; my @parsers = $tr->list_parsers; my %valid_parsers = map { $_, 1 } @parsers; if ($list) { print "\nParsers:\n", map {"\t$_\n"} sort @parsers; print "\n"; exit(0); } pod2usage(msg => 'Too many file args') if @input > 2; my ($source_schema, $source_db, $target_schema, $target_db); my $i = 2; for my $in (@input) { my $file = $in->{'file'}; my $parser = $in->{'parser'}; die "Unable to read file '$file'\n" unless -r $file; die "'$parser' is an invalid parser\n" unless $valid_parsers{$parser}; my $t = SQL::Translator->new; $t->debug($debug); $t->parser($parser) or die $tr->error; my $out = $t->translate($file) or die $tr->error; my $schema = $t->schema; unless ($schema->name) { $schema->name($file); } if ($i == 1) { $source_schema = $schema; $source_db = $parser; } else { $target_schema = $schema; $target_db = $parser; } $i--; } my $case_insensitive = $target_db =~ /SQLServer/; my $s1_name = $source_schema->name; my $s2_name = $target_schema->name; my (@new_tables, @diffs, @diffs_at_end); for my $t1 ($source_schema->get_tables) { my $t1_name = $t1->name; my $t2 = $target_schema->get_table($t1_name, $case_insensitive); warn "TABLE '$s1_name.$t1_name'\n" if $debug; unless ($t2) { warn "Couldn't find table '$s1_name.$t1_name' in '$s2_name'\n" if $debug; if ($target_db =~ /(SQLServer|Oracle)/) { for my $constraint ($t1->get_constraints) { next if $constraint->type ne FOREIGN_KEY; push @diffs_at_end, "ALTER TABLE $t1_name ADD " . constraint_to_string($constraint, $source_schema) . ";"; $t1->drop_constraint($constraint); } } push @new_tables, $t1; next; } # Go through our options my $options_different = 0; my %checkedOptions; OPTION: for my $t1_option_ref ($t1->options) { my ($key1, $value1) = %{$t1_option_ref}; for my $t2_option_ref ($t2->options) { my ($key2, $value2) = %{$t2_option_ref}; if ($key1 eq $key2) { if (defined $value1 != defined $value2) { $options_different = 1; last OPTION; } if (defined $value1 && $value1 ne $value2) { $options_different = 1; last OPTION; } $checkedOptions{$key1} = 1; next OPTION; } } $options_different = 1; last OPTION; } # Go through the other table's options unless ($options_different) { for my $t2_option_ref ($t2->options) { my ($key, $value) = %{$t2_option_ref}; next if $checkedOptions{$key}; $options_different = 1; last; } } # If there's a difference, just re-set all the options my @diffs_table_options; if ($options_different) { my @options = (); foreach my $option_ref ($t1->options) { my ($key, $value) = %{$option_ref}; push(@options, defined $value ? "$key=$value" : $key); } my $options = join(' ', @options); @diffs_table_options = ("ALTER TABLE $t1_name $options;"); } my $t2_name = $t2->name; my (@diffs_table_adds, @diffs_table_changes); for my $t1_field ($t1->get_fields) { my $f1_type = $t1_field->data_type; my $f1_size = $t1_field->size; my $f1_name = $t1_field->name; my $f1_nullable = $t1_field->is_nullable; my $f1_default = $t1_field->default_value; my $f1_auto_inc = $t1_field->is_auto_increment; my $t2_field = $t2->get_field($f1_name, $case_insensitive); my $f1_full_name = "$s1_name.$t1_name.$t1_name"; warn "FIELD '$f1_full_name'\n" if $debug; my $f2_full_name = "$s2_name.$t2_name.$f1_name"; unless ($t2_field) { warn "Couldn't find field '$f2_full_name' in '$t2_name'\n" if $debug; my $temp_default_value = 0; if ( $target_db =~ /SQLServer/ && !$f1_nullable && !defined $f1_default) { # SQL Server doesn't allow adding non-nullable, non-default columns # so we add it with a default value, then remove the default value $temp_default_value = 1; my (@numeric_types) = qw(decimal numeric float real int bigint smallint tinyint); $f1_default = grep($_ eq $f1_type, @numeric_types) ? 0 : ''; } push @diffs_table_adds, sprintf( "ALTER TABLE %s ADD %s%s %s%s%s%s%s%s;", $t1_name, $target_db =~ /Oracle/ ? '(' : '', $f1_name, $f1_type, ($f1_size && $f1_type !~ /(blob|text)$/) ? "($f1_size)" : '', !defined $f1_default ? '' : uc $f1_default eq 'NULL' ? ' DEFAULT NULL' : uc $f1_default eq 'CURRENT_TIMESTAMP' ? ' DEFAULT CURRENT_TIMESTAMP' : " DEFAULT '$f1_default'", $f1_nullable ? '' : ' NOT NULL', $f1_auto_inc ? ' AUTO_INCREMENT' : '', $target_db =~ /Oracle/ ? ')' : '', ); if ($temp_default_value) { undef $f1_default; push @diffs_table_adds, sprintf( <data_type; my $f2_size = $t2_field->size || ''; my $f2_nullable = $t2_field->is_nullable; my $f2_default = $t2_field->default_value; my $f2_auto_inc = $t2_field->is_auto_increment; if (!$t1_field->equals($t2_field, $case_insensitive)) { # SQLServer timestamp fields can't be altered, so we drop and add instead if ($target_db =~ /SQLServer/ && $f2_type eq "timestamp") { push @diffs_table_changes, "ALTER TABLE $t1_name DROP COLUMN $f1_name;"; push @diffs_table_changes, sprintf( "ALTER TABLE %s ADD %s%s %s%s%s%s%s%s;", $t1_name, $target_db =~ /Oracle/ ? '(' : '', $f1_name, $f1_type, ($f1_size && $f1_type !~ /(blob|text)$/) ? "($f1_size)" : '', !defined $f1_default ? '' : uc $f1_default eq 'NULL' ? ' DEFAULT NULL' : uc $f1_default eq 'CURRENT_TIMESTAMP' ? ' DEFAULT CURRENT_TIMESTAMP' : " DEFAULT '$f1_default'", $f1_nullable ? '' : ' NOT NULL', $f1_auto_inc ? ' AUTO_INCREMENT' : '', $target_db =~ /Oracle/ ? ')' : '', ); next; } my $changeText = $target_db =~ /SQLServer/ ? 'ALTER COLUMN' : $target_db =~ /Oracle/ ? 'MODIFY (' : 'CHANGE'; my $nullText = $f1_nullable ? '' : ' NOT NULL'; $nullText = '' if $target_db =~ /Oracle/ && $f1_nullable == $f2_nullable; push @diffs_table_changes, sprintf( "ALTER TABLE %s %s %s%s %s%s%s%s%s%s;", $t1_name, $changeText, $f1_name, $target_db =~ /MySQL/ ? " $f1_name" : '', $f1_type, ($f1_size && $f1_type !~ /(blob|text)$/) ? "($f1_size)" : '', $nullText, !defined $f1_default || $target_db =~ /SQLServer/ ? '' : uc $f1_default eq 'NULL' ? ' DEFAULT NULL' : uc $f1_default eq 'CURRENT_TIMESTAMP' ? ' DEFAULT CURRENT_TIMESTAMP' : " DEFAULT '$f1_default'", $f1_auto_inc ? ' AUTO_INCREMENT' : '', $target_db =~ /Oracle/ ? ')' : '', ); if (defined $f1_default && $target_db =~ /SQLServer/) { # Adding a column with a default value for SQL Server means adding a # constraint and setting existing NULLs to the default value push @diffs_table_changes, sprintf( "ALTER TABLE %s ADD CONSTRAINT DF_%s_%s %s FOR %s;", $t1_name, $t1_name, $f1_name, uc $f1_default eq 'NULL' ? 'DEFAULT NULL' : uc $f1_default eq 'CURRENT_TIMESTAMP' ? 'DEFAULT CURRENT_TIMESTAMP' : "DEFAULT '$f1_default'", $f1_name, ); push @diffs_table_changes, sprintf( "UPDATE %s SET %s = %s WHERE %s IS NULL;", $t1_name, $f1_name, uc $f1_default eq 'NULL' ? 'NULL' : uc $f1_default eq 'CURRENT_TIMESTAMP' ? 'CURRENT_TIMESTAMP' : "'$f1_default'", $f1_name, ); } } } my (%checked_indices, @diffs_index_creates, @diffs_index_drops); INDEX: for my $i1 ($t1->get_indices) { for my $i2 ($t2->get_indices) { if ($i1->equals($i2, $case_insensitive)) { $checked_indices{$i2} = 1; next INDEX; } } push @diffs_index_creates, sprintf( "CREATE %sINDEX%s ON %s (%s);", $i1->type eq NORMAL ? '' : $i1->type . " ", $i1->name ? " " . $i1->name : '', $t1_name, join(",", $i1->fields), ); } INDEX2: for my $i2 ($t2->get_indices) { next if $checked_indices{$i2}; for my $i1 ($t1->get_indices) { next INDEX2 if $i2->equals($i1, $case_insensitive); } $target_db =~ /SQLServer/ ? push @diffs_index_drops, "DROP INDEX $t1_name." . $i2->name . ";" : push @diffs_index_drops, "DROP INDEX " . $i2->name . " on $t1_name;"; } my (%checked_constraints, @diffs_constraint_drops); CONSTRAINT: for my $c1 ($t1->get_constraints) { next if $source_db =~ /Oracle/ && $c1->type eq UNIQUE && $c1->name =~ /^SYS_/i; for my $c2 ($t2->get_constraints) { if ($c1->equals($c2, $case_insensitive)) { $checked_constraints{$c2} = 1; next CONSTRAINT; } } push @diffs_at_end, "ALTER TABLE $t1_name ADD " . constraint_to_string($c1, $source_schema) . ";"; } CONSTRAINT2: for my $c2 ($t2->get_constraints) { next if $checked_constraints{$c2}; for my $c1 ($t1->get_constraints) { next CONSTRAINT2 if $c2->equals($c1, $case_insensitive); } if ($c2->type eq UNIQUE) { push @diffs_constraint_drops, "ALTER TABLE $t1_name DROP INDEX " . $c2->name . ";"; } elsif ($target_db =~ /SQLServer/) { push @diffs_constraint_drops, "ALTER TABLE $t1_name DROP " . $c2->name . ";"; } else { push @diffs_constraint_drops, "ALTER TABLE $t1_name DROP " . $c2->type . ($c2->type eq FOREIGN_KEY ? " " . $c2->name : '') . ";"; } } push @diffs, @diffs_index_drops, @diffs_constraint_drops, @diffs_table_options, @diffs_table_adds, @diffs_table_changes, @diffs_index_creates; } for my $t2 ($target_schema->get_tables) { my $t2_name = $t2->name; my $t1 = $source_schema->get_table($t2_name, $target_db =~ /SQLServer/); unless ($t1) { if ($target_db =~ /SQLServer/) { for my $constraint ($t2->get_constraints) { next if $constraint->type eq PRIMARY_KEY; push @diffs, "ALTER TABLE $t2_name DROP " . $constraint->name . ";"; } } push @diffs_at_end, "DROP TABLE $t2_name;"; next; } for my $t2_field ($t2->get_fields) { my $f2_name = $t2_field->name; my $t1_field = $t1->get_field($f2_name); unless ($t1_field) { my $modifier = $target_db =~ /SQLServer/ ? "COLUMN " : ''; push @diffs, "ALTER TABLE $t2_name DROP $modifier$f2_name;"; } } } if (@new_tables) { my $dummy_tr = SQL::Translator->new; $dummy_tr->schema->add_table($_) for @new_tables; my $producer = $dummy_tr->producer($target_db); unshift @diffs, $producer->($dummy_tr); } push(@diffs, @diffs_at_end); if (@diffs) { if ($source_db !~ /^(MySQL|SQLServer|Oracle)$/) { unshift(@diffs, "-- Target database $target_db is untested/unsupported!!!"); } } if (@diffs) { print join("\n", "-- Convert schema '$s2_name' to '$s1_name':\n", @diffs, "\n"); exit(1); } else { print "There were no differences.\n"; } sub constraint_to_string { my $c = shift; my $schema = shift or die "No schema given"; my @fields = $c->field_names or return ''; if ($c->type eq PRIMARY_KEY) { if ($target_db =~ /Oracle/) { return (defined $c->name ? 'CONSTRAINT ' . $c->name . ' ' : '') . 'PRIMARY KEY (' . join(', ', @fields) . ')'; } else { return 'PRIMARY KEY (' . join(', ', @fields) . ')'; } } elsif ($c->type eq UNIQUE) { if ($target_db =~ /Oracle/) { return (defined $c->name ? 'CONSTRAINT ' . $c->name . ' ' : '') . 'UNIQUE (' . join(', ', @fields) . ')'; } else { return 'UNIQUE ' . (defined $c->name ? $c->name . ' ' : '') . '(' . join(', ', @fields) . ')'; } } elsif ($c->type eq FOREIGN_KEY) { my $def = join(' ', map { $_ || () } 'CONSTRAINT', $c->name, 'FOREIGN KEY'); $def .= ' (' . join(', ', @fields) . ')'; $def .= ' REFERENCES ' . $c->reference_table; my @rfields = map { $_ || () } $c->reference_fields; unless (@rfields) { my $rtable_name = $c->reference_table; if (my $ref_table = $schema->get_table($rtable_name)) { push @rfields, $ref_table->primary_key; } else { warn "Can't find reference table '$rtable_name' " . "in schema\n"; } } if (@rfields) { $def .= ' (' . join(', ', @rfields) . ')'; } else { warn "FK constraint on " . 'some table' . '.' . join('', @fields) . " has no reference fields\n"; } if ($c->match_type) { $def .= ' MATCH ' . ($c->match_type =~ /full/i) ? 'FULL' : 'PARTIAL'; } if ($c->on_delete) { $def .= ' ON DELETE ' . join(' ', $c->on_delete); } if ($c->on_update) { $def .= ' ON UPDATE ' . join(' ', $c->on_update); } return $def; } } # ------------------------------------------------------------------- # Bring out number weight & measure in a year of dearth. # William Blake # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =head1 SEE ALSO SQL::Translator, L. =cut SQL-Translator-1.66/script/sqlt0000755000000000000000000003130314716630117016455 0ustar00rootroot00000000000000#!perl # vim: set ft=perl: # ------------------------------------------------------------------- # Copyright (C) 2002-2009 SQLFairy Authors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; version 2. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. # ------------------------------------------------------------------- =head1 NAME sqlt - convert SQL schema using SQL::Translator =head1 SYNOPSIS For help: sqlt -h|--help For a list of all parsers and producers: sqlt -l|--list To translate a schema: sqlt -f|--from|--parser MySQL -t|--to|--producer Oracle [options] file [file2 ...] General Options: -d|--debug Print debug info -v|--validate Validate the schema --version Show the version of SQL::Translator --trace Print parser trace info --show-warnings Print warnings to STDERR General Parser Options: --skip Comma-separated list of tables to skip (only implemented in some parsers) --ignore_opts Comma-separated list of table options to ignore DBI Parser Options: --dsn DSN for connecting to database (see also --use-same-auth below) --db-user Database user --db-password Database password xSV Parser Options: --fs The field separator --rs The record separator --no-trim Don't trim whitespace on fields --no-scan Don't scan fields for data types and sizes MySQL Parser Options: --mysql-parser-version Target MySQL parser version for dealing with /*! comments; default = 30000 MySQL Producer Options: --mysql-version MySQL server version General Producer Options --producer-db-user Database user for producer --producer-db-pass Database password for producer --producer-dsn DSN for producer --use-same-auth Use these DSN, user, password for producer output DB Producer Options: --add-drop-table Add 'DROP TABLE' statements before creates --quote-table-names Quote all table names in statements --quote-field-names Quote all field names in statements --no-comments Don't include comments in SQL output PostgreSQL Producer Options: --postgres-version PostgreSQL server version Diagram Producer Options: --imap-file Filename to put image map data --imap-url URL to use for image map Dumper Producer Options: --skip Comma-separated list of tables to skip --skiplike Regex for tables to skip --add-truncate Add "TRUNCATE TABLE" statements for each table HTML/POD Producer Options: --pretty Use CGI::Pretty for the output --title Title of schema TTSchema Producer Options: --template The path to the template --tt-var var=value Pass extra variables to the template --tt-conf option=value Pass extra config options to Template XML-SQLFairy Producer Options: --add-prefix Use an explicit namespace prefix of 'sqlf:' --prefix=

Use the namespace prefix given as argument. --no-newlines Write the XML as a single line. --indent= Use characters of whitespace to indent the XML. ClassDBI Producer Options: --package Base package name for Class::DBI modules. =head1 DESCRIPTION This script is part of the SQL Fairy project. It will try to convert any source file for which it has a grammar into any format for which it has a producer. If using "show-warnings," be sure to redirect STDERR to a separate file. In bash, you could do this: $ sql_translator.pl -f MySQL -t PostgreSQL --show-warnings \ file.sql 1>out 2>err You can specify a parser or producer located in any module that Perl knows about, allowing you to easily substitute your own. =cut # ------------------------------------------------------------------- use strict; use warnings; use Getopt::Long; use Pod::Usage; use SQL::Translator; use vars qw( $VERSION ); $VERSION = '1.66'; my $from; # the original database my $to; # the destination database my $help; # show POD and bail my $stdin; # whether to read STDIN for create script my $no_comments; # whether to put comments in out file my $show_warnings; # whether to show warnings from SQL::Translator my $add_drop_table; # whether to add "DROP table" statements my $quote_table_names; # whether to quote table names my $quote_field_names; # whether to quote field names my $debug; # whether to print debug info my $trace; # whether to print parser trace my $list; # list all parsers and producers my $no_trim; # don't trim whitespace on xSV fields my $no_scan; # don't scan xSV fields for data types and sizes my $field_separator; # for xSV files my $record_separator; # for xSV files my $validate; # whether to validate the parsed document my $imap_file; # filename where to place image map coords my $imap_url; # URL to use in making image map my $pretty; # use CGI::Pretty instead of CGI (HTML producer) my $template; # template to pass to TTSchema producer my %tt_vars; # additional template vars to pass the TTSchema producer my %tt_conf; # additional template conf to pass the TTSchema producer my $title; # title for HTML/POD producer my $add_prefix; # Use explicit namespace prefix (XML producer) my $prefix; # Set explicit namespace prefix (XML producer) my $newlines; # Add newlines around tags (XML producer) my $indent; # Number of indent chars for XML my $package_name; # Base class name for ClassDBI my $use_same_auth = 0; # producer uses same DSN, user, password as parser my $dsn; # DBI parser my $db_user; # DBI parser my $db_password; # DBI parser my $show_version; # Show version and exit script my $skip; my $skiplike; my $ignore_opts; my $producer_db_user; # DSN for producer (e.g. Dumper, ClassDBI) my $producer_db_password; # db_pass " my $producer_dsn; # db_user " my $add_truncate; my $mysql_parser_version; # MySQL parser arg for /*! comments my $postgres_version; # PostgreSQL version my $mysql_version; # MySQL version GetOptions( 'add-drop-table' => \$add_drop_table, 'quote-table-names|quote_table_names' => \$quote_table_names, 'quote-field-names|quote_field_names' => \$quote_field_names, 'd|debug' => \$debug, 'f|from|parser:s' => \$from, 'fs:s' => \$field_separator, 'h|help' => \$help, 'imap-file:s' => \$imap_file, 'imap-url:s' => \$imap_url, 't|to|producer:s' => \$to, 'l|list' => \$list, 'pretty!' => \$pretty, 'no-comments' => \$no_comments, 'no-scan' => \$no_scan, 'no-trim' => \$no_trim, 'rs:s' => \$record_separator, 'show-warnings' => \$show_warnings, 'template:s' => \$template, 'tt-var=s' => \%tt_vars, 'tt-conf=s' => \%tt_conf, 'title:s' => \$title, 'trace' => \$trace, 'v|validate' => \$validate, 'dsn:s' => \$dsn, 'db-user:s' => \$db_user, 'db-password:s' => \$db_password, 'producer-dsn:s' => \$producer_dsn, 'producer-db-user:s' => \$producer_db_user, 'producer-db-pass:s' => \$producer_db_password, 'skip:s' => \$skip, 'skiplike:s' => \$skiplike, 'ignore_opts:s' => \$ignore_opts, 'add_truncate' => \$add_truncate, 'add-prefix' => \$add_prefix, 'prefix:s' => \$prefix, 'indent:s' => \$indent, 'newlines!' => \$newlines, 'package=s' => \$package_name, 'use-same-auth' => \$use_same_auth, 'version' => \$show_version, 'mysql-parser-version=i' => \$mysql_parser_version, 'postgres-version=f' => \$postgres_version, 'mysql-version=f' => \$mysql_version, ) or pod2usage(2); if ($use_same_auth) { $producer_dsn = $dsn; $producer_db_user = $db_user; $producer_db_password = $db_password; } if ((!defined $from && defined $dsn) || $from =~ /^DBI.*/) { $from = 'DBI'; } my @files = @ARGV; # source files unless (@files) { if (defined($from) && $from eq 'DBI') { @files = ('!'); } else { @files = ('-'); } } pod2usage(1) if $help; if ($show_version) { print "SQL::Translator v", $SQL::Translator::VERSION, "\n"; exit(0); } my $translator = SQL::Translator->new( debug => $debug || 0, trace => $trace || 0, no_comments => $no_comments || 0, show_warnings => $show_warnings || 0, add_drop_table => $add_drop_table || 0, quote_table_names => defined $quote_table_names ? $quote_table_names : 1, quote_field_names => defined $quote_field_names ? $quote_field_names : 1, validate => $validate || 0, parser_args => { trim_fields => $no_trim ? 0 : 1, scan_fields => $no_scan ? 0 : 1, field_separator => $field_separator, record_separator => $record_separator, dsn => $dsn, db_user => $db_user, db_password => $db_password, mysql_parser_version => $mysql_parser_version, skip => $skip, ignore_opts => $ignore_opts, }, producer_args => { imap_file => $imap_file, imap_url => $imap_url, pretty => $pretty, ttfile => $template, tt_vars => \%tt_vars, tt_conf => \%tt_conf, title => $title, dsn => $producer_dsn, db_user => $producer_db_user, db_password => $producer_db_password, skip => $skip, skiplike => $skiplike, add_truncate => $add_truncate, add_prefix => $add_prefix, prefix => $prefix, indent => $indent, newlines => $newlines, postgres_version => $postgres_version, mysql_version => $mysql_version, package_name => $package_name, }, ); if ($list) { my @parsers = $translator->list_parsers; my @producers = $translator->list_producers; for (@parsers, @producers) { if ($_ =~ m/.+::(\w+)\.pm/) { $_ = $1; } } print "\nParsers:\n", map {"\t$_\n"} sort @parsers; print "\nProducers:\n", map {"\t$_\n"} sort @producers; print "\n"; exit(0); } pod2usage(msg => 'Please supply "from" and "to" arguments') unless $from && $to; $translator->parser($from); $translator->producer($to); for my $file (@files) { my @args = ($file eq '-') ? (data => \*STDIN) : ($file eq '!') ? (data => '') : (file => $file); my $output = $translator->translate(@args) or die "Error: " . $translator->error; print $output; } # ---------------------------------------------------- # It is not all books that are as dull as their readers. # Henry David Thoreau # ---------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE, darren chamberlain Edarren@cpan.orgE. =head1 SEE ALSO SQL::Translator, L. =cut SQL-Translator-1.66/script/sqlt.cgi0000755000000000000000000003470514716630117017227 0ustar00rootroot00000000000000#!perl # ------------------------------------------------------------------- # Copyright (C) 2002-2009 SQLFairy Authors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; version 2. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. # ------------------------------------------------------------------- =head1 NAME sqlt.cgi - CGI front-end for SQL::Translator =head1 DESCRIPTION Place this script in your "cgi-bin" directory and point your browser to it. This script is meant to be a simple graphical interface to all the parsers and producers of SQL::Translator. =cut # ------------------------------------------------------------------- use strict; use warnings; use CGI; use SQL::Translator; use vars '$VERSION'; $VERSION = '1.66'; my $q = CGI->new; eval { if ($q->param) { my $data; if ($q->param('schema')) { $data = $q->param('schema'); } elsif (my $fh = $q->upload('schema_file')) { local $/; $data = <$fh>; } die "No schema provided!\n" unless $data; my $producer = $q->param('producer'); my $output_type = $producer eq 'Diagram' ? $q->param('diagram_output_type') : $producer eq 'GraphViz' ? $q->param('graphviz_output_type') : ''; my $t = SQL::Translator->new( from => $q->param('parser'), producer_args => { add_drop_table => $q->param('add_drop_table'), output_type => $output_type, title => $q->param('title') || 'Schema', natural_join => $q->param('natural_join') eq 'no' ? 0 : 1, join_pk_only => $q->param('natural_join') eq 'pk_only' ? 1 : 0, add_color => $q->param('add_color'), skip_fields => $q->param('skip_fields'), show_fk_only => $q->param('show_fk_only'), font_size => $q->param('font_size'), no_columns => $q->param('no_columns'), node_shape => $q->param('node_shape'), layout => $q->param('layout') || '', height => $q->param('height') || 0, width => $q->param('width') || 0, show_fields => $q->param('show_fields') || 0, ttfile => $q->upload('template'), validate => $q->param('validate'), emit_empty_tags => $q->param('emit_empty_tags'), attrib_values => $q->param('attrib_values'), no_comments => !$q->param('comments'), }, parser_args => { trim_fields => $q->param('trim_fields'), scan_fields => $q->param('scan_fields'), field_separator => $q->param('fs'), record_separator => $q->param('rs'), }, ) or die SQL::Translator->error; my $image_type = ''; my $text_type = 'plain'; if ($output_type =~ /(gif|png|jpeg)/) { $image_type = $output_type; } elsif ($output_type eq 'svg') { $image_type = 'svg+xml'; } elsif ($output_type =~ /gd/) { $image_type = 'png'; } elsif ($output_type eq 'ps') { $text_type = 'postscript'; } elsif ($producer eq 'HTML') { $text_type = 'html'; } my $header_type = $image_type ? "image/$image_type" : "text/$text_type"; $t->data($data); $t->producer($producer); my $output = $t->translate or die $t->error; print $q->header(-type => $header_type), $output; } else { show_form($q); } }; if (my $error = $@) { print $q->header, $q->start_html('Error'), $q->h1('Error'), $error, $q->end_html; } # ------------------------------------------------------------------- sub show_form { my $q = shift; my $title = 'SQL::Translator'; print $q->header, $q->start_html(-title => $title), $q->h1(qq[$title]), $q->start_form(-enctype => 'multipart/form-data'), $q->table( { -border => 1 }, $q->Tr($q->td([ 'Upload your schema file:', $q->filefield(-name => 'schema_file'), ]),), $q->Tr( $q->td([ 'Or paste your schema here:', $q->textarea( -name => 'schema', -rows => 5, -columns => 60, ), ]), ), $q->Tr( $q->td([ 'Parser:', $q->radio_group( -name => 'parser', -values => [ qw( MySQL PostgreSQL Oracle Sybase Excel XML-SQLFairy xSV ) ], -default => 'MySQL', -rows => 3, ), ]), ), $q->Tr( $q->td([ 'Producer:', $q->radio_group( -name => 'producer', -values => [ qw[ ClassDBI Diagram GraphViz HTML MySQL Oracle POD PostgreSQL SQLite Sybase TTSchema XML-SQLFairy ] ], -default => 'GraphViz', -rows => 3, ), ]), ), $q->Tr( $q->td( { -colspan => 2, -align => 'center' }, $q->submit( -name => 'submit', -value => 'Submit', ) ), ), $q->Tr( $q->th( { align => 'left', bgcolor => 'lightgrey', colspan => 2 }, 'General Options:' ), ), $q->Tr( $q->td([ 'Validate Schema:', $q->radio_group( -name => 'validate', -values => [ 1, 0 ], -labels => { 1 => 'Yes', 0 => 'No' }, -default => 0, -rows => 2, ), ]), ), $q->Tr( $q->th( { align => 'left', bgcolor => 'lightgrey', colspan => 2 }, 'DB Producer Options:' ), ), $q->Tr( $q->td([ 'Add "DROP TABLE" statements:', $q->radio_group( -name => 'add_drop_table', -values => [ 1, 0 ], -labels => { 1 => 'Yes', 0 => 'No' }, -default => 0, -rows => 2, ), ]), ), $q->Tr( $q->td([ 'Include comments:', $q->radio_group( -name => 'comments', -values => [ 1, 0 ], -labels => { 1 => 'Yes', 0 => 'No' }, -default => 1, -rows => 2, ), ]), ), $q->Tr( $q->th( { align => 'left', bgcolor => 'lightgrey', colspan => 2 }, 'HTML/POD/Diagram Producer Options:' ), ), $q->Tr( $q->td([ 'Title:', $q->textfield('title'), ]), ), $q->Tr( $q->th( { align => 'left', bgcolor => 'lightgrey', colspan => 2 }, 'TTSchema Producer Options:' ), ), $q->Tr( $q->td([ 'Template:', $q->filefield(-name => 'template'), ]), ), $q->Tr( $q->th( { align => 'left', bgcolor => 'lightgrey', colspan => 2 }, 'Graphical Producer Options' ), ), $q->Tr( $q->td([ 'Perform Natural Joins:', $q->radio_group( -name => 'natural_join', -values => [ 'no', 'yes', 'pk_only' ], -labels => { no => 'No', yes => 'Yes, on all like-named fields', pk_only => 'Yes, but only from primary keys' }, -default => 'no', -rows => 3, ), ]), ), $q->Tr( $q->td([ 'Skip These Fields in Natural Joins:', $q->textarea( -name => 'skip_fields', -rows => 3, -columns => 60, ), ]), ), $q->Tr( $q->td([ 'Show Only Foreign Keys:', $q->radio_group( -name => 'show_fk_only', -values => [ 1, 0 ], -default => 0, -labels => { 1 => 'Yes', 0 => 'No', }, -rows => 2, ), ]), ), $q->Tr( $q->td([ 'Add Color:', $q->radio_group( -name => 'add_color', -values => [ 1, 0 ], -labels => { 1 => 'Yes', 0 => 'No' }, -default => 1, -rows => 2, ), ]), ), $q->Tr( $q->td([ 'Show Field Names:', $q->radio_group( -name => 'show_fields', -values => [ 1, 0 ], -default => 1, -labels => { 1 => 'Yes', 0 => 'No', }, -rows => 2, ), ]), ), $q->Tr( $q->th( { align => 'left', bgcolor => 'lightgrey', colspan => 2 }, 'Diagram Producer Options' ), ), $q->Tr( $q->td([ 'Output Type:', $q->radio_group( -name => 'diagram_output_type', -values => [ 'png', 'jpeg' ], -default => 'png', -rows => 2, ), ]), ), $q->Tr( $q->td([ 'Font Size:', $q->radio_group( -name => 'font_size', -values => [qw( small medium large )], -default => 'medium', -rows => 3, ), ]), ), $q->Tr( $q->td([ 'Number of Columns:', $q->textfield('no_columns'), ]), ), $q->Tr( $q->th( { align => 'left', bgcolor => 'lightgrey', colspan => 2 }, 'GraphViz Producer Options' ), ), $q->Tr( $q->td([ 'Output Type:', $q->radio_group( -name => 'graphviz_output_type', -values => [ qw( canon text ps hpgl pcl mif pic gd gd2 gif jpeg png wbmp cmap ismap imap vrml vtx mp fig svg plain ) ], -default => 'png', -rows => 4, ), ]), ), $q->Tr( $q->td([ 'Layout:', $q->radio_group( -name => 'layout', -values => [qw( dot neato twopi )], -default => 'dot', -rows => 3, ), ]), ), $q->Tr( $q->td([ 'Node Shape:', $q->radio_group( -name => 'node_shape', -values => [ qw( record plaintext ellipse circle egg triangle box diamond trapezium parallelogram house hexagon octagon ) ], -default => 'record', -rows => 4, ), ]), ), $q->Tr( $q->td([ 'Height:', $q->textfield(-name => 'height'), ]), ), $q->Tr( $q->td([ 'Width:', $q->textfield(-name => 'width'), ]), ), $q->Tr( $q->th( { align => 'left', bgcolor => 'lightgrey', colspan => 2 }, 'XML Producer Options:' ), ), $q->Tr( $q->td([ 'Use attributes for values:', $q->radio_group( -name => 'attrib-values', -values => [ 1, 0 ], -labels => { 1 => 'Yes', 0 => 'No' }, -default => 0, -rows => 2, ), ]), ), $q->Tr( $q->td([ 'Emit Empty Tags:', $q->radio_group( -name => 'emit-empty-tags', -values => [ 1, 0 ], -labels => { 1 => 'Yes', 0 => 'No' }, -default => 0, -rows => 2, ), ]), ), $q->Tr( $q->th( { align => 'left', bgcolor => 'lightgrey', colspan => 2 }, 'xSV Parser Options' ), ), $q->Tr( $q->td([ 'Field Separator:', $q->textfield(-name => 'fs'), ]), ), $q->Tr( $q->td([ 'Record Separator:', $q->textfield(-name => 'rs'), ]), ), $q->Tr( $q->td([ 'Trim Whitespace Around Fields:', $q->radio_group( -name => 'trim_fields', -values => [ 1, 0 ], -default => 1, -labels => { 1 => 'Yes', 0 => 'No', }, -rows => 2, ), ]), ), $q->Tr( $q->td([ 'Scan Fields for Data Type:', $q->radio_group( -name => 'scan_fields', -values => [ 1, 0 ], -default => 1, -labels => { 1 => 'Yes', 0 => 'No', }, -rows => 2, ), ]), ), $q->Tr( $q->td( { -colspan => 2, -align => 'center' }, $q->submit( -name => 'submit', -value => 'Submit', ) ), ), ), $q->end_form, $q->end_html; } # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =head1 SEE ALSO L, L =cut SQL-Translator-1.66/script/sqlt-diagram0000755000000000000000000001245014716630117020061 0ustar00rootroot00000000000000#!perl # ------------------------------------------------------------------- # Copyright (C) 2002-2011 SQLFairy Authors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; version 2. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. # ------------------------------------------------------------------- =head1 NAME sqlt-diagram - Automatically create a diagram from a database schema =head1 SYNOPSIS ./sqlt-diagram -d|-f|--from|--db=db_parser [options] schema.sql Options: -o|--output Output file name (default STDOUT) -i|--image Output image type ("png" or "jpeg," default "png") -t|--title Title to give schema -c|--cols Number of columns -n|--no-lines Don't draw lines --font-size Font size ("small," "medium," "large," or "huge," default "medium") --gutter Gutter size between tables --color Add colors --show-fk-only Only show fields that act as primary or foreign keys --natural-join Perform natural joins --natural-join-pk Perform natural joins from primary keys only -s|--skip Fields to skip in natural joins --skip-tables Comma-separated list of table names to exclude --skip-tables-like Comma-separated list of regexen to exclude tables --debug Print debugging information =head1 DESCRIPTION This script will create a picture of your schema. Only the database driver argument (for SQL::Translator) is required. If no output file name is given, then image will be printed to STDOUT, so you should redirect the output into a file. The default action is to assume the presence of foreign key relationships defined via "REFERENCES" or "FOREIGN KEY" constraints on the tables. If you are parsing the schema of a file that does not have these, you will find the natural join options helpful. With natural joins, like-named fields will be considered foreign keys. This can prove too permissive, however, as you probably don't want a field called "name" to be considered a foreign key, so you could include it in the "skip" option, and all fields called "name" will be excluded from natural joins. A more efficient method, however, might be to simply deduce the foreign keys from primary keys to other fields named the same in other tables. Use the "natural-join-pk" option to achieve this. =cut use strict; use warnings; use Data::Dumper; use Getopt::Long; use Pod::Usage; use SQL::Translator; use vars '$VERSION'; $VERSION = '1.66'; # # Get arguments. # my ( $out_file, $output_type, $db_driver, $title, $num_columns, $no_lines, $font_size, $add_color, $debug, $show_fk_only, $gutter, $natural_join, $join_pk_only, $skip_fields, $skip_tables, $skip_tables_like, $help ); GetOptions( 'd|db|f|from=s' => \$db_driver, 'o|output:s' => \$out_file, 'i|image:s' => \$output_type, 't|title:s' => \$title, 'c|columns:i' => \$num_columns, 'n|no-lines' => \$no_lines, 'font-size:s' => \$font_size, 'gutter:i' => \$gutter, 'color' => \$add_color, 'show-fk-only' => \$show_fk_only, 'natural-join' => \$natural_join, 'natural-join-pk' => \$join_pk_only, 's|skip:s' => \$skip_fields, 'skip-tables:s' => \$skip_tables, 'skip-tables-like:s' => \$skip_tables_like, 'debug' => \$debug, 'h|help' => \$help, ) or die pod2usage; my @files = @ARGV; # the create script(s) for the original db pod2usage(1) if $help; pod2usage(-message => "No db driver specified") unless $db_driver; pod2usage(-message => 'No input file') unless @files; my $translator = SQL::Translator->new( from => $db_driver, to => 'Diagram', debug => $debug || 0, producer_args => { out_file => $out_file, output_type => $output_type, gutter => $gutter || 0, title => $title, num_columns => $num_columns, no_lines => $no_lines, font_size => $font_size, add_color => $add_color, show_fk_only => $show_fk_only, natural_join => $natural_join, join_pk_only => $join_pk_only, skip_fields => $skip_fields, skip_tables => $skip_tables, skip_tables_like => $skip_tables_like, }, ) or die SQL::Translator->error; binmode STDOUT unless $out_file; for my $file (@files) { my $output = $translator->translate($file) or die "Error: " . $translator->error; if ($out_file) { print "Image written to '$out_file'. Done.\n"; } else { print $output; } } # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-1.66/README0000664000000000000000000003447114716630506015135 0ustar00rootroot00000000000000NAME SQL::Translator - manipulate structured data definitions (SQL and more) SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new( # Print debug info debug => 1, # Print Parse::RecDescent trace trace => 0, # Don't include comments in output no_comments => 0, # Print name mutations, conflicts show_warnings => 0, # Add "drop table" statements add_drop_table => 1, # to quote or not to quote, thats the question quote_identifiers => 1, # Validate schema object validate => 1, # Make all table names CAPS in producers which support this option format_table_name => sub {my $tablename = shift; return uc($tablename)}, # Null-op formatting, only here for documentation's sake format_package_name => sub {return shift}, format_fk_name => sub {return shift}, format_pk_name => sub {return shift}, ); my $output = $translator->translate( from => 'MySQL', to => 'Oracle', # Or an arrayref of filenames, i.e. [ $file1, $file2, $file3 ] filename => $file, ) or die $translator->error; print $output; DESCRIPTION This documentation covers the API for SQL::Translator. For a more general discussion of how to use the modules and scripts, please see SQL::Translator::Manual. SQL::Translator is a group of Perl modules that converts vendor-specific SQL table definitions into other formats, such as other vendor-specific SQL, ER diagrams, documentation (POD and HTML), XML, and Class::DBI classes. The main focus of SQL::Translator is SQL, but parsers exist for other structured data formats, including Excel spreadsheets and arbitrarily delimited text files. Through the separation of the code into parsers and producers with an object model in between, it's possible to combine any parser with any producer, to plug in custom parsers or producers, or to manipulate the parsed data via the built-in object model. Presently only the definition parts of SQL are handled (CREATE, ALTER), not the manipulation of data (INSERT, UPDATE, DELETE). CONSTRUCTOR new The constructor is called "new", and accepts a optional hash of options. Valid options are: * parser / from * parser_args * producer / to * producer_args * filters * filename / file * data * debug * add_drop_table * quote_identifiers * quote_table_names (DEPRECATED) * quote_field_names (DEPRECATED) * no_comments * trace * validate All options are, well, optional; these attributes can be set via instance methods. Internally, they are; no (non-syntactical) advantage is gained by passing options to the constructor. METHODS add_drop_table Toggles whether or not to add "DROP TABLE" statements just before the create definitions. quote_identifiers Toggles whether or not to quote identifiers (table, column, constraint, etc.) with a quoting mechanism suitable for the chosen Producer. The default (true) is to quote them. quote_table_names DEPRECATED - A legacy proxy to "quote_identifiers" quote_field_names DEPRECATED - A legacy proxy to "quote_identifiers" no_comments Toggles whether to print comments in the output. Accepts a true or false value, returns the current value. producer The "producer" method is an accessor/mutator, used to retrieve or define what subroutine is called to produce the output. A subroutine defined as a producer will be invoked as a function (*not a method*) and passed its container "SQL::Translator" instance, which it should call the "schema" method on, to get the "SQL::Translator::Schema" generated by the parser. It is expected that the function transform the schema structure to a string. The "SQL::Translator" instance is also useful for informational purposes; for example, the type of the parser can be retrieved using the "parser_type" method, and the "error" and "debug" methods can be called when needed. When defining a producer, one of several things can be passed in: A module name (e.g., "My::Groovy::Producer"), a module name relative to the "SQL::Translator::Producer" namespace (e.g., "MySQL"), a module name and function combination ("My::Groovy::Producer::transmogrify"), or a reference to an anonymous subroutine. If a full module name is passed in (for the purposes of this method, a string containing "::" is considered to be a module name), it is treated as a package, and a function called "produce" will be invoked: $modulename::produce. If $modulename cannot be loaded, the final portion is stripped off and treated as a function. In other words, if there is no file named My/Groovy/Producer/transmogrify.pm, "SQL::Translator" will attempt to load My/Groovy/Producer.pm and use "transmogrify" as the name of the function, instead of the default "produce". my $tr = SQL::Translator->new; # This will invoke My::Groovy::Producer::produce($tr, $data) $tr->producer("My::Groovy::Producer"); # This will invoke SQL::Translator::Producer::Sybase::produce($tr, $data) $tr->producer("Sybase"); # This will invoke My::Groovy::Producer::transmogrify($tr, $data), # assuming that My::Groovy::Producer::transmogrify is not a module # on disk. $tr->producer("My::Groovy::Producer::transmogrify"); # This will invoke the referenced subroutine directly, as # $subref->($tr, $data); $tr->producer(\&my_producer); There is also a method named "producer_type", which is a string containing the classname to which the above "produce" function belongs. In the case of anonymous subroutines, this method returns the string "CODE". Finally, there is a method named "producer_args", which is both an accessor and a mutator. Arbitrary data may be stored in name => value pairs for the producer subroutine to access: sub My::Random::producer { my ($tr, $data) = @_; my $pr_args = $tr->producer_args(); # $pr_args is a hashref. Extra data passed to the "producer" method is passed to "producer_args": $tr->producer("xSV", delimiter => ',\s*'); # In SQL::Translator::Producer::xSV: my $args = $tr->producer_args; my $delimiter = $args->{'delimiter'}; # value is ,\s* parser The "parser" method defines or retrieves a subroutine that will be called to perform the parsing. The basic idea is the same as that of "producer" (see above), except the default subroutine name is "parse", and will be invoked as "$module_name::parse($tr, $data)". Also, the parser subroutine will be passed a string containing the entirety of the data to be parsed. # Invokes SQL::Translator::Parser::MySQL::parse() $tr->parser("MySQL"); # Invokes My::Groovy::Parser::parse() $tr->parser("My::Groovy::Parser"); # Invoke an anonymous subroutine directly $tr->parser(sub { my $dumper = Data::Dumper->new([ $_[1] ], [ "SQL" ]); $dumper->Purity(1)->Terse(1)->Deepcopy(1); return $dumper->Dump; }); There is also "parser_type" and "parser_args", which perform analogously to "producer_type" and "producer_args" filters Set or retrieve the filters to run over the schema during the translation, before the producer creates its output. Filters are sub routines called, in order, with the schema object to filter as the 1st arg and a hash of options (passed as a list) for the rest of the args. They are free to do whatever they want to the schema object, which will be handed to any following filters, then used by the producer. Filters are set as an array, which gives the order they run in. Like parsers and producers, they can be defined by a module name, a module name relative to the SQL::Translator::Filter namespace, a module name and function name together or a reference to an anonymous subroutine. When using a module name a function called "filter" will be invoked in that package to do the work. To pass args to the filter set it as an array ref with the 1st value giving the filter (name or sub) and the rest its args. e.g. $tr->filters( sub { my $schema = shift; # Do stuff to schema here! }, DropFKeys, [ "Names", table => 'lc' ], [ "Foo", foo => "bar", hello => "world" ], [ "Filter5" ], ); Although you normally set them in the constructor, which calls through to filters. i.e. my $translator = SQL::Translator->new( ... filters => [ sub { ... }, [ "Names", table => 'lc' ], ], ... ); See t/36-filters.t for more examples. Multiple set calls to filters are cumulative with new filters added to the end of the current list. Returns the filters as a list of array refs, the 1st value being a reference to the filter sub and the rest its args. show_warnings Toggles whether to print warnings of name conflicts, identifier mutations, etc. Probably only generated by producers to let the user know when something won't translate very smoothly (e.g., MySQL "enum" fields into Oracle). Accepts a true or false value, returns the current value. translate The "translate" method calls the subroutine referenced by the "parser" data member, then calls any "filters" and finally calls the "producer" sub routine (these members are described above). It accepts as arguments a number of things, in key => value format, including (potentially) a parser and a producer (they are passed directly to the "parser" and "producer" methods). Here is how the parameter list to "translate" is parsed: * 1 argument means it's the data to be parsed; which could be a string (filename) or a reference to a scalar (a string stored in memory), or a reference to a hash, which is parsed as being more than one argument (see next section). # Parse the file /path/to/datafile my $output = $tr->translate("/path/to/datafile"); # Parse the data contained in the string $data my $output = $tr->translate(\$data); * More than 1 argument means its a hash of things, and it might be setting a parser, producer, or datasource (this key is named "filename" or "file" if it's a file, or "data" for a SCALAR reference. # As above, parse /path/to/datafile, but with different producers for my $prod ("MySQL", "XML", "Sybase") { print $tr->translate( producer => $prod, filename => "/path/to/datafile", ); } # The filename hash key could also be: datasource => \$data, You get the idea. filename, data Using the "filename" method, the filename of the data to be parsed can be set. This method can be used in conjunction with the "data" method, below. If both the "filename" and "data" methods are invoked as mutators, the data set in the "data" method is used. $tr->filename("/my/data/files/create.sql"); or: my $create_script = do { local $/; open CREATE, "/my/data/files/create.sql" or die $!; ; }; $tr->data(\$create_script); "filename" takes a string, which is interpreted as a filename. "data" takes a reference to a string, which is used as the data to be parsed. If a filename is set, then that file is opened and read when the "translate" method is called, as long as the data instance variable is not set. schema Returns the SQL::Translator::Schema object. trace Turns on/off the tracing option of Parse::RecDescent. validate Whether or not to validate the schema object after parsing and before producing. version Returns the version of the SQL::Translator release. AUTHORS See the included AUTHORS file: GETTING HELP/SUPPORT If you are stuck with a problem or have doubts about a particular approach do not hesitate to contact us via any of the following options (the list is sorted by "fastest response time"): * IRC: irc.perl.org#sql-translator * Mailing list: * RT Bug Tracker: HOW TO CONTRIBUTE Contributions are always welcome, in all usable forms (we especially welcome documentation improvements). The delivery methods include git- or unified-diff formatted patches, GitHub pull requests, or plain bug reports either via RT or the Mailing list. Contributors are generally granted access to the official repository after their first several patches pass successful review. Don't hesitate to contact us with any further questions you may have. This project is maintained in a git repository. The code and related tools are accessible at the following locations: * Official repo: * Official gitweb: * GitHub mirror: * Authorized committers: * Travis-CI log: COPYRIGHT Copyright 2012 the SQL::Translator authors, as listed in "AUTHORS". LICENSE This library is free software and may be distributed under the same terms as Perl 5 itself. PRAISE If you find this module useful, please use to rate it. SEE ALSO perl, SQL::Translator::Parser, SQL::Translator::Producer, Parse::RecDescent, GD, GraphViz, Text::RecordParser, Class::DBI, XML::Writer. SQL-Translator-1.66/AUTHORS0000644000000000000000000000514414701227332015307 0ustar00rootroot00000000000000The following people have contributed to the SQLFairy project: - Aaron Schrab - Adam Strzelecki - Alexander Hartmaier - Allen Day - Amiri Barksdale - Anders Nor Berle - André Walker - Andreas 'ac0v' Specht - Andrew Moore - Andrew Gregory - Andrew Pam - Arthur Axel "fREW" Schmidt - Ben Faga - Cedric Carree - Chris Hilton - Chris Mungall - Chris To - Colin Newell - Dagfinn Ilmari MannsÃ¥ker - Daniel Ruoso - Darren Chamberlain - Dave Cash - Fabien Wernli - Fabrice Gabolde - Geoff Cant - Gudmundur A. Thorisson - Guillermo Roditi - Ivan Baidakou (basiliscos) - Jaime Soriano Pastor - Jason Williams - Johan Viklund - John Goulah - John Napiorkowski - Jonathan Yu - Karen Etheridge - Ken Youens-Clark - Kevin McClellan - Lukas 'mauke' Mai - Lukas Thiemeier - Mark Addison - Maximilian Gass - H.Merijn Brand - Michal Jurosz - Mikey Melillo - Moritz Onken - Nick Wellnhofer - Paul Harrington - Peter Rabbitson - Robert Bohne - Ross Smith II - Ryan D Johnson - Salvatore Bonaccorso - Sam Angiuoli - Sebastian Knapp - Stephen Bennett - Stephen Clouse - SymKat - Tina Müller - Vincent Bachelier - Wallace Reis - William Wolf - Ying Zhang - Zefram SQL-Translator-1.66/xt/0000755000000000000000000000000014716630506014675 5ustar00rootroot00000000000000SQL-Translator-1.66/xt/notabs.t0000644000000000000000000000051714701227332016344 0ustar00rootroot00000000000000use warnings; use strict; use Test::More; eval "use Test::NoTabs 1.1"; plan skip_all => 'Test::NoTabs 1.1 required' if $@; Test::NoTabs::all_perl_files_ok(qw|lib t xt script share/DiaUml|,); # FIXME - Test::NoTabs declares 'no_plan' which conflicts with done_testing # https://github.com/schwern/test-more/issues/14 #done_testing; SQL-Translator-1.66/xt/eol.t0000644000000000000000000000054014701227332015631 0ustar00rootroot00000000000000use warnings; use strict; use Test::More; eval "use Test::EOL 1.1"; plan skip_all => 'Test::EOL 1.1 required' if $@; Test::EOL::all_perl_files_ok({ trailing_whitespace => 1 }, qw|lib t xt script share/DiaUml|,); # FIXME - Test::EOL declares 'no_plan' which conflicts with done_testing # https://github.com/schwern/test-more/issues/14 #done_testing; SQL-Translator-1.66/xt/pod.t0000644000000000000000000000016314701227332015635 0ustar00rootroot00000000000000use Test::More; eval "use Test::Pod 1.14"; plan skip_all => 'Test::Pod 1.14 required' if $@; all_pod_files_ok(); SQL-Translator-1.66/maint/0000755000000000000000000000000014716630506015352 5ustar00rootroot00000000000000SQL-Translator-1.66/maint/Makefile.PL.include0000644000000000000000000000640514701227332020744 0ustar00rootroot00000000000000BEGIN { -e 'Distar' or system("git clone https://github.com/p5sagit/Distar.git") } use lib 'Distar/lib'; use Distar 0.001; author 'Ken Youens-Clark '; manifest_include 'script' => qr/.+/; manifest_include 't/data' => qr/.+/; manifest_include 'share' => qr/.+/; manifest_include '' => qr/\A(?:AUTHORS)\z/; # eval so can generate deps for cpanm --installdeps . eval { _recompile_grammars(); _recreate_rt_source(); }; print "Got errors:\n\n$@" if $@; sub _recompile_grammars { return; # disabled until RT#74593 is resolved require File::Spec; my $compiled_parser_dir = File::Spec->catdir(qw/ share PrecompiledParsers Parse RecDescent DDL SQLT /); # Currently consider only single-name parsers containing a grammar marker # This is somewhat fragile, but better than loading all kinds of parsers # to some of which we may not even have the deps my $parser_libdir = 'lib/SQL/Translator/Parser'; for my $parser_fn (glob "$parser_libdir/*.pm") { die "$parser_fn does not look like a readable file\n" unless ( -f $parser_fn and -r $parser_fn ); my ($type) = $parser_fn =~ /^\Q$parser_libdir\E\/(.+)\.pm$/i or die "$parser_fn not named in expected format\n"; my $parser_source = do { local (@ARGV, $/) = $parser_fn; <> }; next unless $parser_source =~ /\$GRAMMAR.+?END_OF_GRAMMAR/s; my $precomp_parser_fn = File::Spec->catfile($compiled_parser_dir, "$type.pm"); next if ( -f $precomp_parser_fn and (stat($parser_fn))[9] <= (stat($precomp_parser_fn))[9] ); print "Precompiling parser for $type\n"; require $parser_fn; require Parse::RecDescent; Parse::RecDescent->Precompile( do { no strict 'refs'; ${"SQL::Translator::Parser::${type}::GRAMMAR"} || die "No \$GRAMMAR global found in SQL::Translator::Parser::$type ($parser_fn)\n" }, "Parse::RecDescent::DDL::SQLT::$type" ); rename( "$type.pm", $precomp_parser_fn ) or die "Unable to move $type.pm to $compiled_parser_dir: $!\n"; } } sub _recreate_rt_source { my $base_xml = "t/data/roundtrip.xml"; my $autogen_yaml = "t/data/roundtrip_autogen.yaml"; print "Updating $autogen_yaml\n"; unlink $autogen_yaml; eval { use lib 'lib'; require SQL::Translator; require SQL::Translator::Parser::XML; open (my $fh, '>', $autogen_yaml) or die "$autogen_yaml: $!\n"; my $tr = SQL::Translator->new; my $yaml = $tr->translate ( parser => 'XML', file => $base_xml, producer => 'YAML', ) or die sprintf ("Unable to translate %s to YAML: %s\n", $base_xml, $tr->error || 'error unknown' ); print $fh $yaml; close $fh; }; if ($@) { die <schema } unless defined $DEFAULT_SUB; with qw( SQL::Translator::Role::Debug SQL::Translator::Role::Error SQL::Translator::Role::BuildArgs ); around BUILDARGS => sub { my $orig = shift; my $self = shift; my $config = $self->$orig(@_); # If a 'parser' or 'from' parameter is passed in, use that as the # parser; if a 'producer' or 'to' parameter is passed in, use that # as the producer; both default to $DEFAULT_SUB. $config->{parser} ||= $config->{from} if defined $config->{from}; $config->{producer} ||= $config->{to} if defined $config->{to}; $config->{filename} ||= $config->{file} if defined $config->{file}; my $quote = normalize_quote_options($config); $config->{quote_identifiers} = $quote if defined $quote; return $config; }; sub BUILD { my ($self) = @_; # Make sure all the tool-related stuff is set up foreach my $tool (qw(producer parser)) { $self->$tool($self->$tool); } } has $_ => ( is => 'rw', default => quote_sub(q{ 0 }), coerce => quote_sub(q{ $_[0] ? 1 : 0 }), ) foreach qw(add_drop_table no_comments show_warnings trace validate); # quote_identifiers is on by default, use a 0-but-true as indicator # so we can allow individual producers to change the default has quote_identifiers => ( is => 'rw', default => quote_sub(q{ '0E0' }), coerce => quote_sub(q{ $_[0] || 0 }), ); sub quote_table_names { (@_ > 1 and ($_[1] xor $_[0]->quote_identifiers)) ? croak 'Using quote_table_names as a setter is no longer supported' : $_[0]->quote_identifiers; } sub quote_field_names { (@_ > 1 and ($_[1] xor $_[0]->quote_identifiers)) ? croak 'Using quote_field_names as a setter is no longer supported' : $_[0]->quote_identifiers; } after quote_identifiers => sub { if (@_ > 1) { # synchronize for old code reaching directly into guts $_[0]->{quote_table_names} = $_[0]->{quote_field_names} = $_[1] ? 1 : 0; } }; has producer => (is => 'rw', default => sub {$DEFAULT_SUB}); around producer => sub { my $orig = shift; shift->_tool( { orig => $orig, name => 'producer', path => "SQL::Translator::Producer", default_sub => "produce", }, @_ ); }; has producer_type => (is => 'rwp', init_arg => undef); around producer_type => carp_ro('producer_type'); has producer_args => (is => 'rw', default => quote_sub(q{ +{} })); around producer_args => sub { my $orig = shift; shift->_args($orig, @_); }; has parser => (is => 'rw', default => sub {$DEFAULT_SUB}); around parser => sub { my $orig = shift; shift->_tool( { orig => $orig, name => 'parser', path => "SQL::Translator::Parser", default_sub => "parse", }, @_ ); }; has parser_type => (is => 'rwp', init_arg => undef); around parser_type => carp_ro('parser_type'); has parser_args => (is => 'rw', default => quote_sub(q{ +{} })); around parser_args => sub { my $orig = shift; shift->_args($orig, @_); }; has filters => ( is => 'rw', default => quote_sub(q{ [] }), coerce => sub { my @filters; # Set. Convert args to list of [\&code,@args] foreach (@{ $_[0] || [] }) { my ($filt, @args) = ref($_) eq "ARRAY" ? @$_ : $_; if (isa($filt, "CODE")) { push @filters, [ $filt, @args ]; next; } else { __PACKAGE__->debug("Adding $filt filter. Args:" . Dumper(\@args) . "\n") if __PACKAGE__->debugging; $filt = _load_sub("$filt\::filter", "SQL::Translator::Filter") || throw(__PACKAGE__->error); push @filters, [ $filt, @args ]; } } return \@filters; }, ); around filters => sub { my $orig = shift; my $self = shift; return @{ $self->$orig([ @{ $self->$orig }, @_ ]) } if @_; return @{ $self->$orig }; }; has filename => ( is => 'rw', isa => sub { foreach my $filename (ref($_[0]) eq 'ARRAY' ? @{ $_[0] } : $_[0]) { if (-d $filename) { throw("Cannot use directory '$filename' as input source"); } elsif (not -f _ && -r _ ) { throw("Cannot use '$filename' as input source: " . "file does not exist or is not readable."); } } }, ); around filename => \&ex2err; has data => ( is => 'rw', builder => 1, lazy => 1, coerce => sub { # Set $self->data based on what was passed in. We will # accept a number of things; do our best to get it right. my $data = shift; if (isa($data, 'ARRAY')) { $data = join '', @$data; } elsif (isa($data, 'GLOB')) { seek($data, 0, 0) if eof($data); local $/; $data = <$data>; } return isa($data, 'SCALAR') ? $data : \$data; }, ); around data => sub { my $orig = shift; my $self = shift; if (@_ > 1 && !ref $_[0]) { return $self->$orig(\join('', @_)); } elsif (@_) { return $self->$orig(@_); } return ex2err($orig, $self); }; sub _build_data { my $self = shift; # If we have a filename but no data yet, populate. if (my $filename = $self->filename) { $self->debug("Opening '$filename' to get contents.\n"); local $/; my $data; my @files = ref($filename) eq 'ARRAY' ? @$filename : ($filename); foreach my $file (@files) { open my $fh, '<', $file or throw("Can't read file '$file': $!"); $data .= <$fh>; close $fh or throw("Can't close file '$file': $!"); } return \$data; } } has schema => ( is => 'lazy', init_arg => undef, clearer => 'reset', predicate => '_has_schema', ); around schema => carp_ro('schema'); around reset => sub { my $orig = shift; my $self = shift; $self->$orig(@_); return 1; }; sub _build_schema { SQL::Translator::Schema->new(translator => shift) } sub translate { my $self = shift; my ($args, $parser, $parser_type, $producer, $producer_type); my ($parser_output, $producer_output, @producer_output); # Parse arguments if (@_ == 1) { # Passed a reference to a hash? if (isa($_[0], 'HASH')) { # yep, a hashref $self->debug("translate: Got a hashref\n"); $args = $_[0]; } # Passed a GLOB reference, i.e., filehandle elsif (isa($_[0], 'GLOB')) { $self->debug("translate: Got a GLOB reference\n"); $self->data($_[0]); } # Passed a reference to a string containing the data elsif (isa($_[0], 'SCALAR')) { # passed a ref to a string $self->debug("translate: Got a SCALAR reference (string)\n"); $self->data($_[0]); } # Not a reference; treat it as a filename elsif (!ref $_[0]) { # Not a ref, it's a filename $self->debug("translate: Got a filename\n"); $self->filename($_[0]); } # Passed something else entirely. else { # We're not impressed. Take your empty string and leave. # return ""; # Actually, if data, parser, and producer are set, then we # can continue. Too bad, because I like my comment # (above)... return "" unless ($self->data && $self->producer && $self->parser); } } else { # You must pass in a hash, or you get nothing. return "" if @_ % 2; $args = {@_}; } # ---------------------------------------------------------------------- # Can specify the data to be transformed using "filename", "file", # "data", or "datasource". # ---------------------------------------------------------------------- if (my $filename = ($args->{'filename'} || $args->{'file'})) { $self->filename($filename); } if (my $data = ($args->{'data'} || $args->{'datasource'})) { $self->data($data); } # ---------------------------------------------------------------- # Get the data. # ---------------------------------------------------------------- my $data = $self->data; # ---------------------------------------------------------------- # Local reference to the parser subroutine # ---------------------------------------------------------------- if ($parser = ($args->{'parser'} || $args->{'from'})) { $self->parser($parser); } $parser = $self->parser; $parser_type = $self->parser_type; # ---------------------------------------------------------------- # Local reference to the producer subroutine # ---------------------------------------------------------------- if ($producer = ($args->{'producer'} || $args->{'to'})) { $self->producer($producer); } $producer = $self->producer; $producer_type = $self->producer_type; # ---------------------------------------------------------------- # Execute the parser, the filters and then execute the producer. # Allowances are made for each piece to die, or fail to compile, # since the referenced subroutines could be almost anything. In # the future, each of these might happen in a Safe environment, # depending on how paranoid we want to be. # ---------------------------------------------------------------- # Run parser unless ($self->_has_schema) { eval { $parser_output = $parser->($self, $$data) }; if ($@ || !$parser_output) { my $msg = sprintf "translate: Error with parser '%s': %s", $parser_type, ($@) ? $@ : " no results"; return $self->error($msg); } } $self->debug("Schema =\n", Dumper($self->schema), "\n") if $self->debugging; # Validate the schema if asked to. if ($self->validate) { my $schema = $self->schema; return $self->error('Invalid schema') unless $schema->is_valid; } # Run filters my $filt_num = 0; foreach ($self->filters) { $filt_num++; my ($code, @args) = @$_; eval { $code->($self->schema, @args) }; my $err = $@ || $self->error || 0; return $self->error("Error with filter $filt_num : $err") if $err; } # Run producer # Calling wantarray in the eval no work, wrong scope. my $wantarray = wantarray ? 1 : 0; eval { if ($wantarray) { @producer_output = $producer->($self); } else { $producer_output = $producer->($self); } }; if ($@ || !($producer_output || @producer_output)) { my $err = $@ || $self->error || "no results"; my $msg = "translate: Error with producer '$producer_type': $err"; return $self->error($msg); } return wantarray ? @producer_output : $producer_output; } sub list_parsers { return shift->_list("parser"); } sub list_producers { return shift->_list("producer"); } # ====================================================================== # Private Methods # ====================================================================== # ---------------------------------------------------------------------- # _args($type, \%args); # # Gets or sets ${type}_args. Called by parser_args and producer_args. # ---------------------------------------------------------------------- sub _args { my $self = shift; my $orig = shift; if (@_) { # If the first argument is an explicit undef (remember, we # don't get here unless there is stuff in @_), then we clear # out the producer_args hash. if (!defined $_[0]) { shift @_; $self->$orig({}); } my $args = isa($_[0], 'HASH') ? shift : {@_}; return $self->$orig({ %{ $self->$orig }, %$args }); } return $self->$orig; } # ---------------------------------------------------------------------- # Does the get/set work for parser and producer. e.g. # return $self->_tool({ # name => 'producer', # path => "SQL::Translator::Producer", # default_sub => "produce", # }, @_); # ---------------------------------------------------------------------- sub _tool { my ($self, $args) = (shift, shift); my $name = $args->{name}; my $orig = $args->{orig}; return $self->{$name} unless @_; # get accessor my $path = $args->{path}; my $default_sub = $args->{default_sub}; my $tool = shift; # passed an anonymous subroutine reference if (isa($tool, 'CODE')) { $self->$orig($tool); $self->${ \"_set_${name}_type" }("CODE"); $self->debug("Got $name: code ref\n"); } # Module name was passed directly # We try to load the name; if it doesn't load, there's a # possibility that it has a function name attached to it, # so we give it a go. else { $tool =~ s/-/::/g if $tool !~ /::/; my ($code, $sub); ($code, $sub) = _load_sub("$tool\::$default_sub", $path); unless ($code) { if (__PACKAGE__->error =~ m/Can't find module/) { # Mod not found so try sub ($code, $sub) = _load_sub("$tool", $path) unless $code; die "Can't load $name subroutine '$tool' : " . __PACKAGE__->error unless $code; } else { die "Can't load $name '$tool' : " . __PACKAGE__->error; } } # get code reference and assign my (undef, $module, undef) = $sub =~ m/((.*)::)?(\w+)$/; $self->$orig($code); $self->${ \"_set_$name\_type" }($sub eq "CODE" ? "CODE" : $module); $self->debug("Got $name: $sub\n"); } # At this point, $self->{$name} contains a subroutine # reference that is ready to run # Anything left? If so, it's args my $meth = "$name\_args"; $self->$meth(@_) if (@_); return $self->{$name}; } # ---------------------------------------------------------------------- # _list($type) # ---------------------------------------------------------------------- sub _list { my $self = shift; my $type = shift || return (); my $uctype = ucfirst lc $type; # # First find all the directories where SQL::Translator # parsers or producers (the "type") appear to live. # load("SQL::Translator::$uctype") or return (); my $path = catfile "SQL", "Translator", $uctype; my @dirs; for (@INC) { my $dir = catfile $_, $path; $self->debug("_list_${type}s searching $dir\n"); next unless -d $dir; push @dirs, $dir; } # # Now use File::File::find to look recursively in those # directories for all the *.pm files, then present them # with the slashes turned into dashes. # my %found; find( sub { if (-f && m/\.pm$/) { my $mod = $_; $mod =~ s/\.pm$//; my $cur_dir = $File::Find::dir; my $base_dir = quotemeta catfile 'SQL', 'Translator', $uctype; # # See if the current directory is below the base directory. # if ($cur_dir =~ m/$base_dir(.*)/) { $cur_dir = $1; $cur_dir =~ s!^/!!; # kill leading slash $cur_dir =~ s!/!-!g; # turn other slashes into dashes } else { $cur_dir = ''; } $found{ join '-', map { $_ || () } $cur_dir, $mod } = 1; } }, @dirs ); return sort { lc $a cmp lc $b } keys %found; } # ---------------------------------------------------------------------- # load(MODULE [,PATH[,PATH]...]) # # Loads a Perl module. Short circuits if a module is already loaded. # # MODULE - is the name of the module to load. # # PATH - optional list of 'package paths' to look for the module in. e.g # If you called load('Super::Foo' => 'My', 'Other') it will # try to load the mod Super::Foo then My::Super::Foo then Other::Super::Foo. # # Returns package name of the module actually loaded or false and sets error. # # Note, you can't load a name from the root namespace (ie one without '::' in # it), therefore a single word name without a path fails. # ---------------------------------------------------------------------- sub load { my $name = shift; my @path; push @path, "" if $name =~ /::/; # Empty path to check name on its own first push @path, @_ if @_; foreach (@path) { my $module = $_ ? "$_\::$name" : $name; my $file = $module; $file =~ s[::][/]g; $file .= ".pm"; __PACKAGE__->debug("Loading $name as $file\n"); return $module if $INC{$file}; # Already loaded eval { require $file }; next if $@ =~ /Can't locate $file in \@INC/; eval { $module->import() } unless $@; return __PACKAGE__->error("Error loading $name as $module : $@") if $@ && $@ !~ /"SQL::Translator::Producer" is not exported/; return $module; # Module loaded ok } return __PACKAGE__->error("Can't find module $name. Path:" . join(",", @path)); } # ---------------------------------------------------------------------- # Load the sub name given (including package), optionally using a base package # path. Returns code ref and name of sub loaded, including its package. # (\&code, $sub) = load_sub( 'MySQL::produce', "SQL::Translator::Producer" ); # (\&code, $sub) = load_sub( 'MySQL::produce', @path ); # ---------------------------------------------------------------------- sub _load_sub { my ($tool, @path) = @_; my (undef, $module, $func_name) = $tool =~ m/((.*)::)?(\w+)$/; if (my $module = load($module => @path)) { my $sub = "$module\::$func_name"; return wantarray ? (\&{$sub}, $sub) : \&$sub; } return undef; } sub format_table_name { return shift->_format_name('_format_table_name', @_); } sub format_package_name { return shift->_format_name('_format_package_name', @_); } sub format_fk_name { return shift->_format_name('_format_fk_name', @_); } sub format_pk_name { return shift->_format_name('_format_pk_name', @_); } # ---------------------------------------------------------------------- # The other format_*_name methods rely on this one. It optionally # accepts a subroutine ref as the first argument (or uses an identity # sub if one isn't provided or it doesn't already exist), and applies # it to the rest of the arguments (if any). # ---------------------------------------------------------------------- sub _format_name { my $self = shift; my $field = shift; my @args = @_; if (ref($args[0]) eq 'CODE') { $self->{$field} = shift @args; } elsif (!exists $self->{$field}) { $self->{$field} = sub { return shift }; } return @args ? $self->{$field}->(@args) : $self->{$field}; } sub isa($$) { my ($ref, $type) = @_; return UNIVERSAL::isa($ref, $type); } sub version { my $self = shift; return $VERSION; } # Must come after all 'has' declarations around new => \&ex2err; 1; # ---------------------------------------------------------------------- # Who killed the pork chops? # What price bananas? # Are you my Angel? # Allen Ginsberg # ---------------------------------------------------------------------- =pod =head1 NAME SQL::Translator - manipulate structured data definitions (SQL and more) =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new( # Print debug info debug => 1, # Print Parse::RecDescent trace trace => 0, # Don't include comments in output no_comments => 0, # Print name mutations, conflicts show_warnings => 0, # Add "drop table" statements add_drop_table => 1, # to quote or not to quote, thats the question quote_identifiers => 1, # Validate schema object validate => 1, # Make all table names CAPS in producers which support this option format_table_name => sub {my $tablename = shift; return uc($tablename)}, # Null-op formatting, only here for documentation's sake format_package_name => sub {return shift}, format_fk_name => sub {return shift}, format_pk_name => sub {return shift}, ); my $output = $translator->translate( from => 'MySQL', to => 'Oracle', # Or an arrayref of filenames, i.e. [ $file1, $file2, $file3 ] filename => $file, ) or die $translator->error; print $output; =head1 DESCRIPTION This documentation covers the API for SQL::Translator. For a more general discussion of how to use the modules and scripts, please see L. SQL::Translator is a group of Perl modules that converts vendor-specific SQL table definitions into other formats, such as other vendor-specific SQL, ER diagrams, documentation (POD and HTML), XML, and Class::DBI classes. The main focus of SQL::Translator is SQL, but parsers exist for other structured data formats, including Excel spreadsheets and arbitrarily delimited text files. Through the separation of the code into parsers and producers with an object model in between, it's possible to combine any parser with any producer, to plug in custom parsers or producers, or to manipulate the parsed data via the built-in object model. Presently only the definition parts of SQL are handled (CREATE, ALTER), not the manipulation of data (INSERT, UPDATE, DELETE). =head1 CONSTRUCTOR =head2 new The constructor is called C, and accepts a optional hash of options. Valid options are: =over 4 =item * parser / from =item * parser_args =item * producer / to =item * producer_args =item * filters =item * filename / file =item * data =item * debug =item * add_drop_table =item * quote_identifiers =item * quote_table_names (DEPRECATED) =item * quote_field_names (DEPRECATED) =item * no_comments =item * trace =item * validate =back All options are, well, optional; these attributes can be set via instance methods. Internally, they are; no (non-syntactical) advantage is gained by passing options to the constructor. =head1 METHODS =head2 add_drop_table Toggles whether or not to add "DROP TABLE" statements just before the create definitions. =head2 quote_identifiers Toggles whether or not to quote identifiers (table, column, constraint, etc.) with a quoting mechanism suitable for the chosen Producer. The default (true) is to quote them. =head2 quote_table_names DEPRECATED - A legacy proxy to L =head2 quote_field_names DEPRECATED - A legacy proxy to L =head2 no_comments Toggles whether to print comments in the output. Accepts a true or false value, returns the current value. =head2 producer The C method is an accessor/mutator, used to retrieve or define what subroutine is called to produce the output. A subroutine defined as a producer will be invoked as a function (I) and passed its container C instance, which it should call the C method on, to get the C generated by the parser. It is expected that the function transform the schema structure to a string. The C instance is also useful for informational purposes; for example, the type of the parser can be retrieved using the C method, and the C and C methods can be called when needed. When defining a producer, one of several things can be passed in: A module name (e.g., C), a module name relative to the C namespace (e.g., C), a module name and function combination (C), or a reference to an anonymous subroutine. If a full module name is passed in (for the purposes of this method, a string containing "::" is considered to be a module name), it is treated as a package, and a function called "produce" will be invoked: C<$modulename::produce>. If $modulename cannot be loaded, the final portion is stripped off and treated as a function. In other words, if there is no file named F, C will attempt to load F and use C as the name of the function, instead of the default C. my $tr = SQL::Translator->new; # This will invoke My::Groovy::Producer::produce($tr, $data) $tr->producer("My::Groovy::Producer"); # This will invoke SQL::Translator::Producer::Sybase::produce($tr, $data) $tr->producer("Sybase"); # This will invoke My::Groovy::Producer::transmogrify($tr, $data), # assuming that My::Groovy::Producer::transmogrify is not a module # on disk. $tr->producer("My::Groovy::Producer::transmogrify"); # This will invoke the referenced subroutine directly, as # $subref->($tr, $data); $tr->producer(\&my_producer); There is also a method named C, which is a string containing the classname to which the above C function belongs. In the case of anonymous subroutines, this method returns the string "CODE". Finally, there is a method named C, which is both an accessor and a mutator. Arbitrary data may be stored in name => value pairs for the producer subroutine to access: sub My::Random::producer { my ($tr, $data) = @_; my $pr_args = $tr->producer_args(); # $pr_args is a hashref. Extra data passed to the C method is passed to C: $tr->producer("xSV", delimiter => ',\s*'); # In SQL::Translator::Producer::xSV: my $args = $tr->producer_args; my $delimiter = $args->{'delimiter'}; # value is ,\s* =head2 parser The C method defines or retrieves a subroutine that will be called to perform the parsing. The basic idea is the same as that of C (see above), except the default subroutine name is "parse", and will be invoked as C<$module_name::parse($tr, $data)>. Also, the parser subroutine will be passed a string containing the entirety of the data to be parsed. # Invokes SQL::Translator::Parser::MySQL::parse() $tr->parser("MySQL"); # Invokes My::Groovy::Parser::parse() $tr->parser("My::Groovy::Parser"); # Invoke an anonymous subroutine directly $tr->parser(sub { my $dumper = Data::Dumper->new([ $_[1] ], [ "SQL" ]); $dumper->Purity(1)->Terse(1)->Deepcopy(1); return $dumper->Dump; }); There is also C and C, which perform analogously to C and C =head2 filters Set or retrieve the filters to run over the schema during the translation, before the producer creates its output. Filters are sub routines called, in order, with the schema object to filter as the 1st arg and a hash of options (passed as a list) for the rest of the args. They are free to do whatever they want to the schema object, which will be handed to any following filters, then used by the producer. Filters are set as an array, which gives the order they run in. Like parsers and producers, they can be defined by a module name, a module name relative to the SQL::Translator::Filter namespace, a module name and function name together or a reference to an anonymous subroutine. When using a module name a function called C will be invoked in that package to do the work. To pass args to the filter set it as an array ref with the 1st value giving the filter (name or sub) and the rest its args. e.g. $tr->filters( sub { my $schema = shift; # Do stuff to schema here! }, DropFKeys, [ "Names", table => 'lc' ], [ "Foo", foo => "bar", hello => "world" ], [ "Filter5" ], ); Although you normally set them in the constructor, which calls through to filters. i.e. my $translator = SQL::Translator->new( ... filters => [ sub { ... }, [ "Names", table => 'lc' ], ], ... ); See F for more examples. Multiple set calls to filters are cumulative with new filters added to the end of the current list. Returns the filters as a list of array refs, the 1st value being a reference to the filter sub and the rest its args. =head2 show_warnings Toggles whether to print warnings of name conflicts, identifier mutations, etc. Probably only generated by producers to let the user know when something won't translate very smoothly (e.g., MySQL "enum" fields into Oracle). Accepts a true or false value, returns the current value. =head2 translate The C method calls the subroutine referenced by the C data member, then calls any C and finally calls the C sub routine (these members are described above). It accepts as arguments a number of things, in key => value format, including (potentially) a parser and a producer (they are passed directly to the C and C methods). Here is how the parameter list to C is parsed: =over =item * 1 argument means it's the data to be parsed; which could be a string (filename) or a reference to a scalar (a string stored in memory), or a reference to a hash, which is parsed as being more than one argument (see next section). # Parse the file /path/to/datafile my $output = $tr->translate("/path/to/datafile"); # Parse the data contained in the string $data my $output = $tr->translate(\$data); =item * More than 1 argument means its a hash of things, and it might be setting a parser, producer, or datasource (this key is named "filename" or "file" if it's a file, or "data" for a SCALAR reference. # As above, parse /path/to/datafile, but with different producers for my $prod ("MySQL", "XML", "Sybase") { print $tr->translate( producer => $prod, filename => "/path/to/datafile", ); } # The filename hash key could also be: datasource => \$data, You get the idea. =back =head2 filename, data Using the C method, the filename of the data to be parsed can be set. This method can be used in conjunction with the C method, below. If both the C and C methods are invoked as mutators, the data set in the C method is used. $tr->filename("/my/data/files/create.sql"); or: my $create_script = do { local $/; open CREATE, "/my/data/files/create.sql" or die $!; ; }; $tr->data(\$create_script); C takes a string, which is interpreted as a filename. C takes a reference to a string, which is used as the data to be parsed. If a filename is set, then that file is opened and read when the C method is called, as long as the data instance variable is not set. =head2 schema Returns the SQL::Translator::Schema object. =head2 trace Turns on/off the tracing option of Parse::RecDescent. =head2 validate Whether or not to validate the schema object after parsing and before producing. =head2 version Returns the version of the SQL::Translator release. =head1 AUTHORS See the included AUTHORS file: L =head1 GETTING HELP/SUPPORT If you are stuck with a problem or have doubts about a particular approach do not hesitate to contact us via any of the following options (the list is sorted by "fastest response time"): =over =item * IRC: irc.perl.org#sql-translator =for html (click for instant chatroom login) =item * Mailing list: L =item * RT Bug Tracker: L =back =head1 HOW TO CONTRIBUTE Contributions are always welcome, in all usable forms (we especially welcome documentation improvements). The delivery methods include git- or unified-diff formatted patches, GitHub pull requests, or plain bug reports either via RT or the Mailing list. Contributors are generally granted access to the official repository after their first several patches pass successful review. Don't hesitate to L us with any further questions you may have. This project is maintained in a git repository. The code and related tools are accessible at the following locations: =over =item * Official repo: L =item * Official gitweb: L =item * GitHub mirror: L =item * Authorized committers: L =item * Travis-CI log: L =for html ↪ Stable branch CI status: =back =head1 COPYRIGHT Copyright 2012 the SQL::Translator authors, as listed in L. =head1 LICENSE This library is free software and may be distributed under the same terms as Perl 5 itself. =head1 PRAISE If you find this module useful, please use L to rate it. =head1 SEE ALSO L, L, L, L, L, L, L, L, L. SQL-Translator-1.66/lib/SQL/Translator/0000755000000000000000000000000014716630506017600 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Manual.pod0000644000000000000000000004547614701227332021532 0ustar00rootroot00000000000000=head1 NAME SQL::Translator::Manual - sqlfairy user manual =head1 SYNOPSIS SQL::Translator (AKA "SQLFairy") is a collection of modules for transforming (mainly) SQL DDL files into a variety of other formats, including other SQL dialects, documentation, images, and code. In this manual, we will attempt to address how to use SQLFairy for common tasks. For a lower-level discussion of how the code works, please read the documentation for L. It may prove helpful to have a general understanding of the SQLFairy code before continuing. The code can be broken into three conceptual groupings: =over 4 =item * Parsers The parsers are responsible for reading the input files and describing them to the Schema object middleware. =item * Producers The producers create the output as described by the Schema middleware. =item * Schema objects The Schema objects bridge the communication between the Parsers and Producers by representing any parsed file through a standard set of generic objects to represent concepts like Tables, Fields (columns), Indices, Constraints, etc. =back It's not necessary to understand how to write or manipulate any of these for most common tasks, but you should aware of the concepts as they will be referenced later in this document. =head1 SQLFAIRY SCRIPTS Most common tasks can be accomplished through the use of the script interfaces to the SQL::Translator code. All SQLFairy scripts begin with "sqlt." Here are the scripts and a description of what they each do: =over 4 =item * sqlt This is the main interface for text-to-text translations, e.g., converting a MySQL schema to Oracle. =item * sqlt-diagram This is a tailored interface for the Diagram producer and its many myriad options. =item * sqlt-diff This script will examine two schemas and report the SQL commands (ALTER, CREATE) needed to turn the first schema into the second. =item * sqlt-dumper This script generates a Perl script that can be used to connect to a database and dump the data in each table in different formats, similar to the "mysqldump" program. =item * sqlt-graph This is an interface to the GraphViz visualization tool and its myriad options. =item * sqlt.cgi This is a CGI script that presents an HTML form for uploading or pasting a schema and choosing an output and the output options. =back To read the full documentation for each script, use "perldoc" (or execute any of the command-line scripts with the "--help" flag). =head1 CONVERTING SQL DIALECTS Probably the most common task SQLFairy is used for is to convert one dialect of SQL to another. If you have a text description of an SQL database (AKA a "DDL" -- "Data Definition Language"), then you should use the "sqlt" script with switches to indicate the parser and producer and the name of the text file as the final argument. For example, to convert the "foo.sql" MySQL schema to a version suitable for PostgreSQL, you would do the following: $ sqlt -f MySQL -t PostgreSQL foo.sql > foo-pg.sql The "from" and "to" options are case-sensitive and must match exactly the names of the Parser and Producer classes in SQL::Translator. For a complete listing of your options, execute "sqlt" with the "--list" flag. =head1 EXTRACT SQL SCHEMAS DIRECTLY FROM DATABASE It is possible to extract some schemas directly from the database without parsing a text file (the "foo.sql" in the above example). This can prove significantly faster than parsing a text file. To do this, use the "DBI" parser and provide the necessary arguments to connect to the database and indicate the producer class, like so: $ sqlt -f DBI --dsn dbi:mysql:FOO --db-user guest \ --db-password p4ssw0rd -t PostgreSQL > foo The "--list" option to "sqlt" will show the databases supported by DBI parsers. =head1 HANDLING NON-SQL DATA Certain structured document formats can be easily thought of as tables. SQLFairy can parse Microsoft Excel spreadsheets and arbitrarily delimited text files just as if they were schemas which contained only one table definition. The column names are normalized to something sane for most databases (whitespace is converted to underscores and non-word characters are removed), and the data in each field is scanned to determine the appropriate data type (character, integer, or float) and size. For instance, to convert a comma-separated file to an SQLite database, do the following: $ sqlt -f xSV --fs ',' -t SQLite foo.csv > foo-sqlite.sql Additionally, there is a non-SQL representation of relational schemas namely XML. Additionally, the only XML supported is our own version; however, it would be fairly easy to add an XML parser for something like the TorqueDB (http://db.apache.org/torque/) project. The actual parsing of XML should be trivial given the number of XML parsers available, so all that would be left would be to map the specific concepts in the source file to the Schema objects in SQLFairy. To convert a schema in SQLFairy's XML dialect to Oracle, do the following: $ sqlt -f XML-SQLFairy -t Oracle foo.xml > foo-oracle.sql =head1 SERIALIZING SCHEMAS Parsing a schema is generally the most computationally expensive operation performed by SQLFairy, so it may behoove you to serialize a parsed schema if you need to perform repeated conversions. For example, as part of a build process the author converts a MySQL schema first to YAML, then to PostgreSQL, Oracle, SQLite and Sybase. Additionally, a variety of documentation in HTML and images is produced. This can be accomplished like so: $ sqlt -f MySQL -t YAML schema-mysql.sql > schema.yaml $ sqlt -f YAML -t Oracle schema.yaml > schema-oracle.sql $ sqlt -f YAML -t PostgreSQL schema.yaml > schema-postgresql.sql $ ... SQLFairy has three serialization producers, none of which is superior to the other in their description of a schema. =over 4 =item * XML-SQLFairy This is the aforementioned XML format. It is essentially a direct mapping of the Schema objects into XML. This can also provide a very convenient bridge to describing a schema to a non-Perl application. Providing a producer argument to "sqlt" of just "XML" will default to using "XML-SQLFairy." =item * Storable This producer stores the Schema object using Perl's Storable.pm module available on CPAN. =item * YAML This producer serialized the Schema object with the very readable structured data format of YAML (http://www.yaml.org/). Earlier examples show serializing to YAML. =back =head1 VISUALIZING SQL SCHEMAS The visualization tools in SQLFairy can graphically represent the tables, fields, datatypes and sizes, constraints, and foreign key relationships in a very compact and intuitive format. This can be very beneficial in understanding and document large or small schemas. Two producers in SQLFairy will create pseudo-E/R (entity-relationship) diagrams: =over 4 =item * Diagram The first visualization tool in SQLFairy, this producer uses libgd to draw a picture of the schema. The tables are evenly distributed in definition order running in columns (i.e., no graphing algorithms are used), so the many of the lines showing the foreign key relationships may cross over each other and the table boxes. Please read the documentation of the "sqlt-diagram" script for all the options available to this producer. =item * GraphViz The layout of the GraphViz producer is far superior to the Diagram producer as it uses the Graphviz binary from Bell Labs to create very professional-looking graphs. There are several different layout algorithms and node shapes available. Please see the documentation of the "sqlt-graph" script for more information. =back =head1 AUTOMATED CODE-GENERATION Given that so many applications interact with SQL databases, it's no wonder that people have automated code to deal with this interaction. Class::DBI from CPAN is one such module that allows a developer to describe the relationships between tables and fields in class declarations and then generates all the SQL to interact (SELECT, UPDATE, DELETE, INSERT statements) at runtime. Obviously, the schema already describes itself, so it only makes sense that you should be able to generate this kind of code directly from the schema. The "ClassDBI" producer in SQLFairy does just this, creating a Perl module that inherits from Class::DBI and sets up most of the code needed to interact with the database. Here is an example of how to do this: $ sqlt -f MySQL -t ClassDBI foo.sql > Foo.pm Then simply edit Foo.pm as needed and include it in your code. =head1 CREATING A DATA DUMPER SCRIPT The Dumper producer creates a Perl script that can select the fields in each table and then create "INSERT" statements for each record in the database similar to the output generated by MySQL's "mysqldump" program: $ sqlt -f YAML -t Dumper --dumper-db-user guest \ > --dumper-db-pass p4ssw0rd --dumper-dsn dbi:mysql:FOO \ > foo.yaml > foo-dumper.pl And then execute the resulting script to dump the data: $ chmod +x foo-dumper.pl $ ./foo-dumper.pl > foo-data.sql The dumper script also has a number of options available. Execute the script with the "--help" flag to read about them. =head1 DOCUMENTING WITH SQL::TRANSLATOR SQLFairy offers two producers to help document schemas: =over 4 =item * HTML This producer creates a single HTML document which uses HTML formatting to describe the Schema objects and to create hyperlinks on foreign key relationships. This can be a surprisingly useful documentation aid as it creates a very readable format that allows one to jump easily to specific tables and fields. It's also possible to plugin your own CSS to further control the presentation of the HTML. =item * POD This is arguably not that useful of a producer by itself, but the number of POD-conversion tools could be used to further transform the POD into something more interesting. The schema is basically represented in POD sections where tables are broken down into fields, indices, constraints, foreign keys, etc. =back =head1 TEMPLATE-BASED MANIPULATION OF SCHEMA OBJECTS All of the producers which create text output could have been coded using a templating system to mix in the dynamic output with static text. CPAN offers several diverse templating systems, but few are as powerful as Template Toolkit (http://www.template-toolkit.org/). You can easily create your own producer without writing any Perl code at all simply by writing a template using Template Toolkit's syntax. The template will be passed a reference to the Schema object briefly described at the beginning of this document and mentioned many times throughout. For example, you could create a template that simply prints the name of each table and field that looks like this: # file: schema.tt [% FOREACH table IN schema.get_tables %] Table: [% table.name %] Fields: [% FOREACH field IN table.get_fields -%] [% field.name %] [% END -%] [% END %] And then process it like so: $ sqlt -f YAML -t TTSchema --template schema.tt foo.yaml To create output like this: Table: foo Fields: foo_id foo_name For more information on Template Toolkit, please install the "Template" module and read the POD. =head1 FINDING THE DIFFERENCES BETWEEN TWO SCHEMAS As mentioned above, the "sqlt-diff" schema examines two schemas and creates SQL schema modification statements that can be used to transform the first schema into the second. The flag syntax is somewhat quirky: $ sqlt-diff foo-v1.sql=MySQL foo-v2.sql=Oracle > diff.sql As demonstrated, the schemas need not even be from the same vendor, though this is likely to produce some spurious results as datatypes are not currently viewed equivalent unless they match exactly, even if they would be converted to the same. For example, MySQL's "integer" data type would be converted to Oracle's "number," but the differ isn't quite smart enough yet to figure this out. Also, as the SQL to ALTER a field definition varies from database vendor to vendor, these statements are made using just the keyword "CHANGE" and will likely need to be corrected for the target database. =head1 A UNIFIED GRAPHICAL INTERFACE Seeing all the above options and scripts, you may be pining for a single, graphical interface to handle all these transformations and choices. This is exactly what the "sqlt.cgi" script provides. Simply drop this script into your web server's CGI directory and enable the execute bit and you can point your web browser to an HTML form which provides a simple interface to all the SQLFairy parsers and producers. =head1 PLUGIN YOUR OWN PARSERS AND PRODUCERS Now that you have seen how the parsers and producers interact via the Schema objects, you may wish to create your own versions to plugin. Producers are probably the easier concept to grok, so let's cover that first. By far the easiest way to create custom output is to use the TTSchema producer in conjunction with a Template Toolkit template as described earlier. However, you can also easily pass a reference to a subroutine that SQL::Translator can call for the production of the output. This subroutine will be passed a single argument of the SQL::Translator object which you can use to access the Schema objects. Please read the POD for SQL::Translator and SQL::Translator::Schema to learn the methods you can call. Here is a very simple example: #!/usr/bin/perl use strict; use SQL::Translator; my $input = q[ create table foo ( foo_id int not null default '0' primary key, foo_name varchar(30) not null default '' ); create table bar ( bar_id int not null default '0' primary key, bar_value varchar(100) not null default '' ); ]; my $t = SQL::Translator->new; $t->parser('MySQL') or die $t->error; $t->producer( \&produce ) or die $t->error; my $output = $t->translate( \$input ) or die $t->error; print $output; sub produce { my $tr = shift; my $schema = $tr->schema; my $output = ''; for my $t ( $schema->get_tables ) { $output .= join('', "Table = ", $t->name, "\n"); } return $output; } Executing this script produces the following: $ ./my-producer.pl Table = foo Table = bar A custom parser will be passed two arguments: the SQL::Translator object and the data to be parsed. In this example, the schema will be represented in a simple text format. Each line is a table definition where the fields are separated by colons. The first field is the table name and the following fields are column definitions where the column name, data type and size are separated by spaces. The specifics of the example are unimportant -- what is being demonstrated is that you have to decide how to parse the incoming data and then map the concepts in the data to the Schema object. #!/usr/bin/perl use strict; use SQL::Translator; my $input = "foo:foo_id int 11:foo_name varchar 30\n" . "bar:bar_id int 11:bar_value varchar 30" ; my $t = SQL::Translator->new; $t->parser( \&parser ) or die $t->error; $t->producer('Oracle') or die $t->error; my $output = $t->translate( \$input ) or die $t->error; print $output; sub parser { my ( $tr, $data ) = @_; my $schema = $tr->schema; for my $line ( split( /\n/, $data ) ) { my ( $table_name, @fields ) = split( /:/, $line ); my $table = $schema->add_table( name => $table_name ) or die $schema->error; for ( @fields ) { my ( $f_name, $type, $size ) = split; $table->add_field( name => $f_name, data_type => $type, size => $size, ) or die $table->error; } } return 1; } And here is the output produced by this script: -- -- Created by SQL::Translator::Producer::Oracle -- Created on Wed Mar 31 15:43:30 2004 -- -- -- Table: foo -- CREATE TABLE foo ( foo_id number(11), foo_name varchar2(30) ); -- -- Table: bar -- CREATE TABLE bar ( bar_id number(11), bar_value varchar2(30) ); If you create a useful parser or producer, you are encouraged to submit your work to the SQLFairy project! =head1 PLUGIN TEMPLATE TOOLKIT PRODUCERS You may find that the TTSchema producer doesn't give you enough control over templating and you want to play with the Template config or add you own variables. Or maybe you just have a really good template you want to submit to SQLFairy :) If so, the SQL::Translator::Producer::TT::Base producer may be just for you! Instead of working like a normal producer it provides a base class so you can cheaply build new producer modules based on templates. It's simplest use is when we just want to put a single template in its own module. So to create a Foo producer we create a F file as follows, putting our template in the __DATA__ section. package Custom::Foo.pm; use base qw/SQL::Translator::Producer::TT::Base/; # Use our new class as the producer sub produce { return __PACKAGE__->new( translator => shift )->run; }; __DATA__ [% FOREACH table IN schema.get_tables %] Table: [% table.name %] Fields: [% FOREACH field IN table.get_fields -%] [% field.name %] [% END -%] [% END %] For that we get a producer called Custom::Foo that we can now call like a normal producer (as long as the directory with F is in our @INC path): $ sqlt -f YAML -t Custom-Foo foo.yaml The template gets variables of C and C to use in building its output. You also get a number of methods you can override to hook into the template generation. B Allows you to set the config options used by the Template object. The Template Toolkit provides a huge number of options which allow you to do all sorts of magic (See L for details). This method provides a hook into them by returning a hash of options for the Template. e.g. Say you want to use the INTERPOLATE option to save some typing in your template; sub tt_config { ( INTERPOLATE => 1 ); } Another common use for this is to add you own filters to the template: sub tt_config {( INTERPOLATE => 1, FILTERS => { foo_filter => \&foo_filter, } );} Another common extension is adding your own template variables. This is done with B: sub tt_vars { ( foo => "bar" ); } What about using template files instead of DATA sections? You can already - if you give a template on the command line your new producer will use that instead of reading the DATA section: $ sqlt -f YAML -t Custom-Foo --template foo.tt foo.yaml This is useful as you can set up a producer that adds a set of filters and variables that you can then use in templates given on the command line. (There is also a tt_schema method to over ride if you need even finer control over the source of your template). Note that if you leave out the DATA section all together then your producer will require a template file name to be given. See L for more details. =head1 AUTHOR Ken Y. Clark Ekclark@cpan.orgE. SQL-Translator-1.66/lib/SQL/Translator/Utils.pm0000644000000000000000000004042714716630117021243 0ustar00rootroot00000000000000package SQL::Translator::Utils; use strict; use warnings; use Digest::SHA qw( sha1_hex ); use File::Spec; use Scalar::Util qw(blessed); use Try::Tiny; use Carp qw(carp croak); use List::Util qw(any); our $VERSION = '1.66'; use base qw(Exporter); our @EXPORT_OK = qw( debug normalize_name header_comment parse_list_arg truncate_id_uniquely $DEFAULT_COMMENT parse_mysql_version parse_dbms_version ddl_parser_instance batch_alter_table_statements uniq throw ex2err carp_ro normalize_quote_options ); use constant COLLISION_TAG_LENGTH => 8; our $DEFAULT_COMMENT = '--'; sub debug { my ($pkg, $file, $line, $sub) = caller(0); { no strict qw(refs); return unless ${"$pkg\::DEBUG"}; } $sub =~ s/^$pkg\:://; while (@_) { my $x = shift; chomp $x; $x =~ s/\bPKG\b/$pkg/g; $x =~ s/\bLINE\b/$line/g; $x =~ s/\bSUB\b/$sub/g; #warn '[' . $x . "]\n"; print STDERR '[' . $x . "]\n"; } } sub normalize_name { my $name = shift or return ''; # The name can only begin with a-zA-Z_; if there's anything # else, prefix with _ $name =~ s/^([^a-zA-Z_])/_$1/; # anything other than a-zA-Z0-9_ in the non-first position # needs to be turned into _ $name =~ tr/[a-zA-Z0-9_]/_/c; # All duplicated _ need to be squashed into one. $name =~ tr/_/_/s; # Trim a trailing _ $name =~ s/_$//; return $name; } sub normalize_quote_options { my $config = shift; my $quote; if (defined $config->{quote_identifiers}) { $quote = $config->{quote_identifiers}; for (qw/quote_table_names quote_field_names/) { carp "Ignoring deprecated parameter '$_', since 'quote_identifiers' is supplied" if defined $config->{$_}; } } # Legacy one set the other is not elsif (defined $config->{'quote_table_names'} xor defined $config->{'quote_field_names'}) { if (defined $config->{'quote_table_names'}) { carp "Explicitly disabling the deprecated 'quote_table_names' implies disabling 'quote_identifiers' which in turn implies disabling 'quote_field_names'" unless $config->{'quote_table_names'}; $quote = $config->{'quote_table_names'} ? 1 : 0; } else { carp "Explicitly disabling the deprecated 'quote_field_names' implies disabling 'quote_identifiers' which in turn implies disabling 'quote_table_names'" unless $config->{'quote_field_names'}; $quote = $config->{'quote_field_names'} ? 1 : 0; } } # Legacy both are set elsif (defined $config->{'quote_table_names'}) { croak 'Setting quote_table_names and quote_field_names to conflicting values is no longer supported' if ($config->{'quote_table_names'} xor $config->{'quote_field_names'}); $quote = $config->{'quote_table_names'} ? 1 : 0; } return $quote; } sub header_comment { my $producer = shift || caller; my $comment_char = shift; my $now = scalar localtime; $comment_char = $DEFAULT_COMMENT unless defined $comment_char; my $header_comment = <<"HEADER_COMMENT"; ${comment_char} ${comment_char} Created by $producer ${comment_char} Created on $now ${comment_char} HEADER_COMMENT # Any additional stuff passed in for my $additional_comment (@_) { $header_comment .= "${comment_char} ${additional_comment}\n"; } return $header_comment; } sub parse_list_arg { my $list = UNIVERSAL::isa($_[0], 'ARRAY') ? shift : [@_]; # # This protects stringification of references. # if (any { ref $_ } @$list) { return $list; } # # This processes string-like arguments. # else { return [ map { s/^\s+|\s+$//g; $_ } map { split /,/ } grep { defined && length } @$list ]; } } sub truncate_id_uniquely { my ($desired_name, $max_symbol_length) = @_; return $desired_name unless defined $desired_name && length $desired_name > $max_symbol_length; my $truncated_name = substr $desired_name, 0, $max_symbol_length - COLLISION_TAG_LENGTH - 1; # Hex isn't the most space-efficient, but it skirts around allowed # charset issues my $digest = sha1_hex($desired_name); my $collision_tag = substr $digest, 0, COLLISION_TAG_LENGTH; return $truncated_name . '_' . $collision_tag; } sub parse_mysql_version { my ($v, $target) = @_; return undef unless $v; $target ||= 'perl'; my @vers; # X.Y.Z style if ($v =~ / ^ (\d+) \. (\d{1,3}) (?: \. (\d{1,3}) )? $ /x) { push @vers, $1, $2, $3; } # XYYZZ (mysql) style elsif ($v =~ / ^ (\d) (\d{2}) (\d{2}) $ /x) { push @vers, $1, $2, $3; } # XX.YYYZZZ (perl) style or simply X elsif ($v =~ / ^ (\d+) (?: \. (\d{3}) (\d{3}) )? $ /x) { push @vers, $1, $2, $3; } else { #how do I croak sanely here? die "Unparseable MySQL version '$v'"; } if ($target eq 'perl') { return sprintf('%d.%03d%03d', map { $_ || 0 } (@vers)); } elsif ($target eq 'mysql') { return sprintf('%d%02d%02d', map { $_ || 0 } (@vers)); } else { #how do I croak sanely here? die "Unknown version target '$target'"; } } sub parse_dbms_version { my ($v, $target) = @_; return undef unless $v; my @vers; # X.Y.Z style if ($v =~ / ^ (\d+) \. (\d{1,3}) (?: \. (\d{1,3}) )? $ /x) { push @vers, $1, $2, $3; } # XX.YYYZZZ (perl) style or simply X elsif ($v =~ / ^ (\d+) (?: \. (\d{3}) (\d{3}) )? $ /x) { push @vers, $1, $2, $3; } else { #how do I croak sanely here? die "Unparseable database server version '$v'"; } if ($target eq 'perl') { return sprintf('%d.%03d%03d', map { $_ || 0 } (@vers)); } elsif ($target eq 'native') { return join '.' => grep defined, @vers; } else { #how do I croak sanely here? die "Unknown version target '$target'"; } } #my ($parsers_libdir, $checkout_dir); sub ddl_parser_instance { my $type = shift; # it may differ from our caller, even though currently this is not the case eval "require SQL::Translator::Parser::$type" or die "Unable to load grammar-spec container SQL::Translator::Parser::$type:\n$@"; # handle DB2 in a special way, since the grammar source was lost :( if ($type eq 'DB2') { require SQL::Translator::Parser::DB2::Grammar; return SQL::Translator::Parser::DB2::Grammar->new; } require Parse::RecDescent; return Parse::RecDescent->new(do { no strict 'refs'; ${"SQL::Translator::Parser::${type}::GRAMMAR"} || die "No \$SQL::Translator::Parser::${type}::GRAMMAR defined, unable to instantiate PRD parser\n"; }); # this is disabled until RT#74593 is resolved =begin sadness unless ($parsers_libdir) { # are we in a checkout? if ($checkout_dir = _find_co_root()) { $parsers_libdir = File::Spec->catdir($checkout_dir, 'share', 'PrecompiledParsers'); } else { require File::ShareDir; $parsers_libdir = File::Spec->catdir( File::ShareDir::dist_dir('SQL-Translator'), 'PrecompiledParsers' ); } unshift @INC, $parsers_libdir; } my $precompiled_mod = "Parse::RecDescent::DDL::SQLT::$type"; # FIXME FIXME FIXME # Parse::RecDescent has horrible architecture where each precompiled parser # instance shares global state with all its siblings # What we do here is gross, but scarily efficient - the parser compilation # is much much slower than an unload/reload cycle require Class::Unload; Class::Unload->unload($precompiled_mod); # There is also a sub-namespace that P::RD uses, but simply unsetting # $^W to stop redefine warnings seems to be enough #Class::Unload->unload("Parse::RecDescent::$precompiled_mod"); eval "local \$^W; require $precompiled_mod" or do { if ($checkout_dir) { die "Unable to find precompiled grammar for $type - run Makefile.PL to generate it\n"; } else { die "Unable to load precompiled grammar for $type... this is not supposed to happen if you are not in a checkout, please file a bugreport:\n$@" } }; my $grammar_spec_fn = $INC{"SQL/Translator/Parser/$type.pm"}; my $precompiled_fn = $INC{"Parse/RecDescent/DDL/SQLT/$type.pm"}; if ( (stat($grammar_spec_fn))[9] > (stat($precompiled_fn))[9] ) { die ( "Grammar spec '$grammar_spec_fn' is newer than precompiled parser '$precompiled_fn'" . ($checkout_dir ? " - run Makefile.PL to regenerate stale versions\n" : "... this is not supposed to happen if you are not in a checkout, please file a bugreport\n" ) ); } return $precompiled_mod->new; =end sadness =cut } # Try to determine the root of a checkout/untar if possible # or return undef sub _find_co_root { my @mod_parts = split /::/, (__PACKAGE__ . '.pm'); my $rel_path = join('/', @mod_parts); # %INC stores paths with / regardless of OS return undef unless ($INC{$rel_path}); # a bit convoluted, but what we do here essentially is: # - get the file name of this particular module # - do 'cd ..' as many times as necessary to get to lib/SQL/Translator/../../.. my $root = (File::Spec::Unix->splitpath($INC{$rel_path}))[1]; for (1 .. @mod_parts) { $root = File::Spec->catdir($root, File::Spec->updir); } return (-f File::Spec->catfile($root, 'Makefile.PL')) ? $root : undef; } { package SQL::Translator::Utils::Error; use overload '""' => sub { ${ $_[0] } }, fallback => 1; sub new { my ($class, $msg) = @_; bless \$msg, $class; } } sub uniq { my (%seen, $seen_undef, $numeric_preserving_copy); grep { not(defined $_ ? $seen{ $numeric_preserving_copy = $_ }++ : $seen_undef++) } @_; } sub throw { die SQL::Translator::Utils::Error->new($_[0]); } sub ex2err { my ($orig, $self, @args) = @_; return try { $self->$orig(@args); } catch { die $_ unless blessed($_) && $_->isa("SQL::Translator::Utils::Error"); $self->error("$_"); }; } sub carp_ro { my ($name) = @_; return sub { my ($orig, $self) = (shift, shift); carp "'$name' is a read-only accessor" if @_; return $self->$orig; }; } sub batch_alter_table_statements { my ($diff_hash, $options, @meths) = @_; @meths = qw( rename_table alter_drop_constraint alter_drop_index drop_field add_field alter_field rename_field alter_create_index alter_create_constraint alter_table ) unless @meths; my $package = caller; return map { my $meth = $package->can($_) or die "$package cant $_"; map { $meth->(ref $_ eq 'ARRAY' ? @$_ : $_, $options) } @{ $diff_hash->{$_} } } grep { @{ $diff_hash->{$_} || [] } } @meths; } 1; =pod =head1 NAME SQL::Translator::Utils - SQL::Translator Utility functions =head1 SYNOPSIS use SQL::Translator::Utils qw(debug); debug("PKG: Bad things happened"); =head1 DESCSIPTION C contains utility functions designed to be used from the other modules within the C modules. Nothing is exported by default. =head1 EXPORTED FUNCTIONS AND CONSTANTS =head2 debug C takes 0 or more messages, which will be sent to STDERR using C. Occurances of the strings I, I, and I will be replaced by the calling package, subroutine, and line number, respectively, as reported by C. For example, from within C in F, at line 666: debug("PKG: Error reading file at SUB/LINE"); Will warn [SQL::Translator: Error reading file at foo/666] The entire message is enclosed within C<[> and C<]> for visual clarity when STDERR is intermixed with STDOUT. =head2 normalize_name C takes a string and ensures that it is suitable for use as an identifier. This means: ensure that it starts with a letter or underscore, and that the rest of the string consists of only letters, numbers, and underscores. A string that begins with something other than [a-zA-Z] will be prefixer with an underscore, and all other characters in the string will be replaced with underscores. Finally, a trailing underscore will be removed, because that's ugly. normalize_name("Hello, world"); Produces: Hello_world A more useful example, from the C test suite: normalize_name("silly field (with random characters)"); returns: silly_field_with_random_characters =head2 header_comment Create the header comment. Takes 1 mandatory argument (the producer classname), an optional comment character (defaults to $DEFAULT_COMMENT), and 0 or more additional comments, which will be appended to the header, prefixed with the comment character. If additional comments are provided, then a comment string must be provided ($DEFAULT_COMMENT is exported for this use). For example, this: package My::Producer; use SQL::Translator::Utils qw(header_comment $DEFAULT_COMMENT); print header_comment(__PACKAGE__, $DEFAULT_COMMENT, "Hi mom!"); produces: -- -- Created by My::Prodcuer -- Created on Fri Apr 25 06:56:02 2003 -- -- Hi mom! -- Note the gratuitous spacing. =head2 parse_list_arg Takes a string, list or arrayref (all of which could contain comma-separated values) and returns an array reference of the values. All of the following will return equivalent values: parse_list_arg('id'); parse_list_arg('id', 'name'); parse_list_arg( 'id, name' ); parse_list_arg( [ 'id', 'name' ] ); parse_list_arg( qw[ id name ] ); =head2 truncate_id_uniquely Takes a string ($desired_name) and int ($max_symbol_length). Truncates $desired_name to $max_symbol_length by including part of the hash of the full name at the end of the truncated name, giving a high probability that the symbol will be unique. For example, truncate_id_uniquely( 'a' x 100, 64 ) truncate_id_uniquely( 'a' x 99 . 'b', 64 ); truncate_id_uniquely( 'a' x 99, 64 ) Will give three different results; specifically: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_7f900025 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_6191e39a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_8cd96af2 =head2 $DEFAULT_COMMENT This is the default comment string, '--' by default. Useful for C. =head2 parse_mysql_version Used by both L and L in order to provide a consistent format for both C<< parser_args->{mysql_parser_version} >> and C<< producer_args->{mysql_version} >> respectively. Takes any of the following version specifications: 5.0.3 4.1 3.23.2 5 5.001005 (perl style) 30201 (mysql style) =head2 parse_dbms_version Takes a version string (X.Y.Z) or perl style (XX.YYYZZZ) and a target ('perl' or 'native') transforms the string to the given target style. to =head2 throw Throws the provided string as an object that will stringify back to the original string. This stops it from being mangled by L's C code. =head2 ex2err Wraps an attribute accessor to catch any exception raised using L and store them in C<< $self->error() >>, finally returning undef. A reference to this function can be passed directly to L. around foo => \&ex2err; around bar => sub { my ($orig, $self) = (shift, shift); return ex2err($orig, $self, @_) if @_; ... }; =head2 carp_ro Takes a field name and returns a reference to a function can be used L a read-only accessor to make it L instead of die when passed an argument. =head2 batch_alter_table_statements Takes diff and argument hashes as passed to L and an optional list of producer functions to call on the calling package. Returns the list of statements returned by the producer functions. If no producer functions are specified, the following functions in the calling package are called: =over =item 1. rename_table =item 2. alter_drop_constraint =item 3. alter_drop_index =item 4. drop_field =item 5. add_field =item 5. alter_field =item 6. rename_field =item 7. alter_create_index =item 8. alter_create_constraint =item 9. alter_table =back If the corresponding array in the hash has any elements, but the caller doesn't implement that function, an exception is thrown. =head1 AUTHORS Darren Chamberlain Edarren@cpan.orgE, Ken Y. Clark Ekclark@cpan.orgE. =cut SQL-Translator-1.66/lib/SQL/Translator/Generator/0000755000000000000000000000000014716630506021526 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Generator/Role/0000755000000000000000000000000014716630506022427 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Generator/Role/DDL.pm0000644000000000000000000000504714701227332023367 0ustar00rootroot00000000000000package SQL::Translator::Generator::Role::DDL; =head1 NAME SQL::Translator::Generator::Role::DDL - Role implementing common parts of DDL generation. =head1 DESCRIPTION I =cut use Moo::Role; use SQL::Translator::Utils qw(header_comment); use Scalar::Util; requires '_build_type_map'; requires '_build_numeric_types'; requires '_build_unquoted_defaults'; requires '_build_sizeless_types'; requires 'quote'; requires 'quote_string'; has type_map => (is => 'lazy',); has numeric_types => (is => 'lazy',); has sizeless_types => (is => 'lazy',); has unquoted_defaults => (is => 'lazy',); has add_comments => (is => 'ro',); has add_drop_table => (is => 'ro',); # would also be handy to have a required size set if there is such a thing sub field_name { $_[0]->quote($_[1]->name) } sub field_comments { ($_[1]->comments ? ('-- ' . $_[1]->comments . "\n ") : ()) } sub table_comments { my ($self, $table) = @_; if ($self->add_comments) { return ("", "--", "-- Table: " . $self->quote($table->name) . "", "--", map "-- $_", $table->comments); } else { return (); } } sub field_nullable { ($_[1]->is_nullable ? $_[0]->nullable : 'NOT NULL') } sub field_default { my ($self, $field, $exceptions) = @_; my $default = $field->default_value; return () if !defined $default; $default = \"$default" if $exceptions and !ref $default and $exceptions->{$default}; if (ref $default) { $default = $$default; } elsif (!($self->numeric_types->{ lc($field->data_type) } && Scalar::Util::looks_like_number($default))) { $default = $self->quote_string($default); } return ("DEFAULT $default"); } sub field_type { my ($self, $field) = @_; my $field_type = $field->data_type; ($self->type_map->{$field_type} || $field_type) . $self->field_type_size($field); } sub field_type_size { my ($self, $field) = @_; ( $field->size && !$self->sizeless_types->{ $field->data_type } ? '(' . $field->size . ')' : '' ); } sub fields { my ($self, $table) = @_; (map $self->field($_), $table->get_fields); } sub indices { my ($self, $table) = @_; (map $self->index($_), $table->get_indices); } sub nullable {'NULL'} sub header_comments { header_comment() . "\n" if $_[0]->add_comments } 1; =head1 AUTHORS See the included AUTHORS file: L =head1 COPYRIGHT Copyright (c) 2012 the SQL::Translator L as listed above. =head1 LICENSE This code is free software and may be distributed under the same terms as Perl itself. =cut SQL-Translator-1.66/lib/SQL/Translator/Generator/Role/Quote.pm0000644000000000000000000000265114701227332024057 0ustar00rootroot00000000000000package SQL::Translator::Generator::Role::Quote; use Moo::Role; =head1 NAME SQL::Translator::Generator::Role::Quote - Role for dealing with identifier quoting. =head1 DESCRIPTION I =cut requires qw(quote_chars name_sep); has escape_char => ( is => 'ro', lazy => 1, clearer => 1, default => sub { $_[0]->quote_chars->[-1] }, ); sub quote { my ($self, $label) = @_; return '' unless defined $label; return $$label if ref($label) eq 'SCALAR'; my @quote_chars = @{ $self->quote_chars }; return $label unless scalar @quote_chars; my ($l, $r); if (@quote_chars == 1) { ($l, $r) = (@quote_chars) x 2; } elsif (@quote_chars == 2) { ($l, $r) = @quote_chars; } else { die 'too many quote chars!'; } my $sep = $self->name_sep || ''; my $esc = $self->escape_char; # parts containing * are naturally unquoted join $sep, map { (my $n = $_) =~ s/\Q$r/$esc$r/g; "$l$n$r" } ($sep ? split(/\Q$sep\E/, $label) : $label); } sub quote_string { my ($self, $string) = @_; return $string unless defined $string; $string =~ s/'/''/g; return qq{'$string'}; } 1; =head1 AUTHORS See the included AUTHORS file: L =head1 COPYRIGHT Copyright (c) 2012 the SQL::Translator L as listed above. =head1 LICENSE This code is free software and may be distributed under the same terms as Perl itself. =cut SQL-Translator-1.66/lib/SQL/Translator/Generator/DDL/0000755000000000000000000000000014716630506022131 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Generator/DDL/MySQL.pm0000644000000000000000000000054314701227332023427 0ustar00rootroot00000000000000package SQL::Translator::Generator::DDL::MySQL; =head1 NAME SQL::Translator::Generator::DDL::MySQL - A Moo based MySQL DDL generation engine. =head1 DESCRIPTION I =cut use Moo; has quote_chars => (is => 'ro', default => sub { +[qw(` `)] }); with 'SQL::Translator::Generator::Role::Quote'; sub name_sep {q(.)} 1; SQL-Translator-1.66/lib/SQL/Translator/Generator/DDL/PostgreSQL.pm0000644000000000000000000000133014701227332024460 0ustar00rootroot00000000000000package SQL::Translator::Generator::DDL::PostgreSQL; =head1 NAME SQL::Translator::Generator::DDL::PostgreSQL - A Moo based PostgreSQL DDL generation engine. =head1 DESCRIPTION I =cut use Moo; has quote_chars => ( is => 'rw', default => sub { +[qw(" ")] }, trigger => sub { $_[0]->clear_escape_char }, ); with 'SQL::Translator::Generator::Role::Quote'; sub name_sep {q(.)} 1; =head1 AUTHORS See the included AUTHORS file: L =head1 COPYRIGHT Copyright (c) 2012 the SQL::Translator L as listed above. =head1 LICENSE This code is free software and may be distributed under the same terms as Perl itself. =cut SQL-Translator-1.66/lib/SQL/Translator/Generator/DDL/SQLServer.pm0000644000000000000000000001463414701227332024316 0ustar00rootroot00000000000000package SQL::Translator::Generator::DDL::SQLServer; =head1 NAME SQL::Translator::Generator::DDL::SQLServer - A Moo based MS SQL Server DDL generation engine. =head1 DESCRIPTION I =cut use Moo; use SQL::Translator::Schema::Constants; with 'SQL::Translator::Generator::Role::Quote'; with 'SQL::Translator::Generator::Role::DDL'; sub quote_chars { [qw([ ])] } sub name_sep {q(.)} sub _build_numeric_types { +{ int => 1, }; } sub _build_unquoted_defaults { +{ NULL => 1, }; } sub _build_type_map { +{ date => 'datetime', 'time' => 'datetime', }; } sub _build_sizeless_types { +{ map { $_ => 1 } qw( tinyint smallint int integer bigint text bit image datetime ) }; } sub field { my ($self, $field) = @_; return join ' ', $self->field_name($field), ($self->field_type($field) || die 'type is required'), $self->field_autoinc($field), $self->field_nullable($field), $self->field_default($field),; } sub field_autoinc { ($_[1]->is_auto_increment ? 'IDENTITY' : ()) } sub primary_key_constraint { 'CONSTRAINT ' . $_[0]->quote($_[1]->name || $_[1]->table->name . '_pk') . ' PRIMARY KEY (' . join(', ', map $_[0]->quote($_), $_[1]->fields) . ')'; } sub index { 'CREATE INDEX ' . $_[0]->quote($_[1]->name || $_[1]->table->name . '_idx') . ' ON ' . $_[0]->quote($_[1]->table->name) . ' (' . join(', ', map $_[0]->quote($_), $_[1]->fields) . ');'; } sub unique_constraint_single { my ($self, $constraint) = @_; 'CONSTRAINT ' . $self->unique_constraint_name($constraint) . ' UNIQUE (' . join(', ', map $self->quote($_), $constraint->fields) . ')'; } sub unique_constraint_name { my ($self, $constraint) = @_; $self->quote($constraint->name || $constraint->table->name . '_uc'); } sub unique_constraint_multiple { my ($self, $constraint) = @_; 'CREATE UNIQUE NONCLUSTERED INDEX ' . $self->unique_constraint_name($constraint) . ' ON ' . $self->quote($constraint->table->name) . ' (' . join(', ', map $self->quote($_), $constraint->fields) . ')' . ' WHERE ' . join(' AND ', map $self->quote($_->name) . ' IS NOT NULL', grep { $_->is_nullable } $constraint->fields) . ';'; } sub foreign_key_constraint { my ($self, $constraint) = @_; my $on_delete = uc($constraint->on_delete || ''); my $on_update = uc($constraint->on_update || ''); # The default implicit constraint action in MSSQL is RESTRICT # but you can not specify it explicitly. Go figure :) for (map uc $_ || '', $on_delete, $on_update) { undef $_ if $_ eq 'RESTRICT'; } 'ALTER TABLE ' . $self->quote($constraint->table->name) . ' ADD CONSTRAINT ' . $self->quote($constraint->name || $constraint->table->name . '_fk') . ' FOREIGN KEY' . ' (' . join(', ', map $self->quote($_), $constraint->fields) . ') REFERENCES ' . $self->quote($constraint->reference_table) . ' (' . join(', ', map $self->quote($_), $constraint->reference_fields) . ')' . ( $on_delete && $on_delete ne "NO ACTION" ? ' ON DELETE ' . $on_delete : '' ) . ( $on_update && $on_update ne "NO ACTION" ? ' ON UPDATE ' . $on_update : '' ) . ';'; } sub enum_constraint_name { my ($self, $field_name) = @_; $self->quote($field_name . '_chk'); } sub enum_constraint { my ($self, $field_name, $vals) = @_; return ('CONSTRAINT ' . $self->enum_constraint_name($field_name) . ' CHECK (' . $self->quote($field_name) . ' IN (' . join(',', map $self->quote_string($_), @$vals) . '))'); } sub constraints { my ($self, $table) = @_; ( map $self->enum_constraint($_->name, { $_->extra }->{list} || []), grep { 'enum' eq lc $_->data_type } $table->get_fields ), (map $self->primary_key_constraint($_), grep { $_->type eq PRIMARY_KEY } $table->get_constraints), ( map $self->unique_constraint_single($_), grep { $_->type eq UNIQUE && !grep { $_->is_nullable } $_->fields } $table->get_constraints ), ; } sub table { my ($self, $table) = @_; join("\n", $self->table_comments($table), '') . join("\n\n", 'CREATE TABLE ' . $self->quote($table->name) . " (\n" . join(",\n", map {" $_"} $self->fields($table), $self->constraints($table),) . "\n);", $self->unique_constraints_multiple($table), $self->indices($table),); } sub unique_constraints_multiple { my ($self, $table) = @_; ( map $self->unique_constraint_multiple($_), grep { $_->type eq UNIQUE && grep { $_->is_nullable } $_->fields } $table->get_constraints ); } sub drop_table { my ($self, $table) = @_; my $name = $table->name; my $q_name = $self->quote($name); "IF EXISTS (SELECT name FROM sysobjects WHERE name = '$name' AND type = 'U')" . " DROP TABLE $q_name;"; } sub remove_table_constraints { my ($self, $table) = @_; my $name = $table->name; my $q_name = $self->quote($name); "IF EXISTS (SELECT name FROM sysobjects WHERE name = '$name' AND type = 'U')" . " ALTER TABLE $q_name NOCHECK CONSTRAINT all;"; } sub drop_tables { my ($self, $schema) = @_; if ($self->add_drop_table) { my @tables = sort { $b->order <=> $a->order } $schema->get_tables; return join "\n", ( ( $self->add_comments ? ('--', '-- Turn off constraints', '--', '',) : () ), (map $self->remove_table_constraints($_), @tables), ($self->add_comments ? ('--', '-- Drop tables', '--', '',) : ()), (map $self->drop_table($_), @tables), ); } return ''; } sub foreign_key_constraints { my ($self, $schema) = @_; ( map $self->foreign_key_constraint($_), grep { $_->type eq FOREIGN_KEY } map $_->get_constraints, $schema->get_tables ); } sub schema { my ($self, $schema) = @_; $self->header_comments . $self->drop_tables($schema) . join("\n\n", map $self->table($_), grep { $_->name } $schema->get_tables) . "\n" . join "\n", $self->foreign_key_constraints($schema); } 1; =head1 AUTHORS See the included AUTHORS file: L =head1 COPYRIGHT Copyright (c) 2012 the SQL::Translator L as listed above. =head1 LICENSE This code is free software and may be distributed under the same terms as Perl itself. =cut SQL-Translator-1.66/lib/SQL/Translator/Generator/DDL/SQLite.pm0000644000000000000000000000501414701227332023621 0ustar00rootroot00000000000000package SQL::Translator::Generator::DDL::SQLite; =head1 NAME SQL::Translator::Generator::DDL::SQLite - A Moo based SQLite DDL generation engine. =head1 DESCRIPTION I =cut use Moo; has quote_chars => (is => 'ro', default => sub { +[qw(" ")] }); with 'SQL::Translator::Generator::Role::Quote'; with 'SQL::Translator::Generator::Role::DDL'; sub name_sep {q(.)} sub _build_type_map { +{ set => 'varchar', bytea => 'blob', }; } sub _build_sizeless_types { +{ text => 1, blob => 1, }; } sub _build_numeric_types { +{ int => 1, integer => 1, tinyint => 1, smallint => 1, mediumint => 1, bigint => 1, 'unsigned big int' => 1, int2 => 1, int8 => 1, numeric => 1, decimal => 1, boolean => 1, real => 1, double => 1, 'double precision' => 1, float => 1, }; } sub _build_unquoted_defaults { +{ NULL => 1, 'now()' => 1, CURRENT_TIMESTAMP => 1, }; } sub nullable { () } sub _ipk { my ($self, $field) = @_; my $pk = $field->table->primary_key; my @pk_fields = $pk ? $pk->fields : (); $field->is_primary_key && scalar @pk_fields == 1 && ($field->data_type =~ /int(eger)?$/i || ($field->data_type =~ /^number?$/i && $field->size !~ /,/)); } sub field_autoinc { my ($self, $field) = @_; return ( ( ($field->extra->{auto_increment_type} || '') eq 'monotonic' and $self->_ipk($field) and $field->is_auto_increment ) ? 'AUTOINCREMENT' : '' ); } sub field { my ($self, $field) = @_; return join ' ', $self->field_comments($field), $self->field_name($field), ( $self->_ipk($field) ? ('INTEGER PRIMARY KEY') : ($self->field_type($field)) ), ($self->field_autoinc($field) || ()), $self->field_nullable($field), $self->field_default( $field, { NULL => 1, 'now()' => 1, 'CURRENT_TIMESTAMP' => 1, } ), ; } 1; =head1 AUTHORS See the included AUTHORS file: L =head1 COPYRIGHT Copyright (c) 2012 the SQL::Translator L as listed above. =head1 LICENSE This code is free software and may be distributed under the same terms as Perl itself. =cut SQL-Translator-1.66/lib/SQL/Translator/Types.pm0000644000000000000000000000463114701227332021237 0ustar00rootroot00000000000000package SQL::Translator::Types; use warnings; use strict; =head1 NAME SQL::Translator::Types - Type checking functions =head1 SYNOPSIS package Foo; use Moo; use SQL::Translator::Types qw(schema_obj enum); has foo => ( is => 'rw', isa => schema_obj('Trigger') ); has bar => ( is => 'rw', isa => enum([qw(baz quux quuz)], { msg => "Invalid value for bar: '%s'", icase => 1, }); =head1 DESCRIPTIONS This module exports functions that return coderefs suitable for L C type checks. Errors are reported using L. =cut use SQL::Translator::Utils qw(throw); use Scalar::Util qw(blessed); use Exporter qw(import); our @EXPORT_OK = qw(schema_obj enum); =head1 FUNCTIONS =head2 schema_obj($type) Returns a coderef that checks that its arguments is an object of the class C<< SQL::Translator::Schema::I<$type> >>. =cut sub schema_obj { my ($class) = @_; my $name = lc $class; $class = 'SQL::Translator::Schema' . ($class eq 'Schema' ? '' : "::$class"); return sub { throw("Not a $name object") unless blessed($_[0]) and $_[0]->isa($class); }; } =head2 enum(\@strings, [$msg | \%parameters]) Returns a coderef that checks that the argument is one of the provided C<@strings>. =head3 Parameters =over =item msg L string for the error message. If no other parameters are needed, this can be provided on its own, instead of the C<%parameters> hashref. The invalid value is passed as the only argument. Defaults to C. =item icase If true, folds the values to lower case before checking for equality. =item allow_undef If true, allow C in addition to the specified strings. =item allow_false If true, allow any false value in addition to the specified strings. =back =cut sub enum { my ($values, $args) = @_; $args ||= {}; $args = { msg => $args } unless ref($args) eq 'HASH'; my $icase = !!$args->{icase}; my %values = map { ($icase ? lc : $_) => undef } @{$values}; my $msg = $args->{msg} || "Invalid value: '%s'"; my $extra_test = $args->{allow_undef} ? sub { defined $_[0] } : $args->{allow_false} ? sub { !!$_[0] } : undef; return sub { my $val = $icase ? lc $_[0] : $_[0]; throw(sprintf($msg, $val)) if (!defined($extra_test) || $extra_test->($val)) && !exists $values{$val}; }; } 1; SQL-Translator-1.66/lib/SQL/Translator/Role/0000755000000000000000000000000014716630506020501 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Role/Error.pm0000644000000000000000000000300214701227332022114 0ustar00rootroot00000000000000package SQL::Translator::Role::Error; =head1 NAME SQL::Translator::Role::Error - Error setter/getter for objects and classes =head1 SYNOPSIS In the class consuming the role: package Foo; use Moo; with qw(SQL::Translator::Role::Error); sub foo { ... return $self->error("Something failed") unless $some_condition; ... } In code using the class: Foo->foo or die Foo->error; # or $foo->foo or die $foo->error; =head1 DESCRIPTION This L provides a method for getting and setting error on a class or object. =cut use Moo::Role; use Sub::Quote qw(quote_sub); has _ERROR => ( is => 'rw', accessor => 'error', init_arg => undef, default => quote_sub(q{ '' }), ); =head1 METHODS =head2 $object_or_class->error([$message]) If called with an argument, sets the error message and returns undef, otherwise returns the message. As an implementation detail, for compatibility with L, the message is stored in C<< $object->{_ERROR} >> or C<< $Class::ERROR >>, depending on whether the invocant is an object. =cut around error => sub { my ($orig, $self) = (shift, shift); # Emulate horrible Class::Base API unless (ref($self)) { my $errref = do { no strict 'refs'; \${"${self}::ERROR"} }; return $$errref unless @_; $$errref = $_[0]; return undef; } return $self->$orig unless @_; $self->$orig(@_); return undef; }; =head1 SEE ALSO =over =item * L =back =cut 1; SQL-Translator-1.66/lib/SQL/Translator/Role/ListAttr.pm0000644000000000000000000000550714701227332022605 0ustar00rootroot00000000000000package SQL::Translator::Role::ListAttr; use warnings; use strict; =head1 NAME SQL::Translator::Role::ListAttr - context-sensitive list attributes =head1 SYNOPSIS package Foo; use Moo; use SQL::Translator::Role::ListAttr; with ListAttr foo => ( uniq => 1, append => 1 ); =head1 DESCRIPTION This package provides a variable L for context-sensitive list attributes. =cut use SQL::Translator::Utils qw(parse_list_arg ex2err uniq); use Sub::Quote qw(quote_sub); use Package::Variant ( importing => { 'Moo::Role' => [], }, subs => [qw(has around)], ); =head1 FUNCTIONS =head2 ListAttr $name => %parameters; Returns a L providing an arrayref attribute named C<$name>, and wrapping the accessor to provide context-sensitivity both for setting and getting. If no C or C is provided, the default value is the empty list. On setting, the arguments are parsed using L, and the accessor will return an array reference or a list, depending on context. =head3 Parameters =over =item append If true, the setter will append arguments to the existing ones, rather than replacing them. =item uniq If true, duplicate items will be removed, keeping the first one seen. =item may_throw If accessing the attribute might L an exception (e.g. from a C or C check), this should be set to make the accessor store the exception using L and return undef. =item undef_if_empty If true, and the list is empty, the accessor will return C instead of a reference to an empty in scalar context. =back Unknown parameters are passed through to the L call for the attribute. =cut sub make_variant { my ($class, $target_package, $name, %arguments) = @_; my $may_throw = delete $arguments{may_throw}; my $undef_if_empty = delete $arguments{undef_if_empty}; my $append = delete $arguments{append}; my $coerce = delete $arguments{uniq} ? sub { [ uniq @{ parse_list_arg($_[0]) } ] } : \&parse_list_arg; has($name => ( is => 'rw', (!$arguments{builder} ? (default => quote_sub(q{ [] }),) : ()), coerce => $coerce, %arguments, )); around( $name => sub { my ($orig, $self) = (shift, shift); my $list = parse_list_arg(@_); $self->$orig([ @{ $append ? $self->$orig : [] }, @$list ]) if @$list; my $return; if ($may_throw) { $return = ex2err($orig, $self) or return; } else { $return = $self->$orig; } my $scalar_return = !@{$return} && $undef_if_empty ? undef : $return; return wantarray ? @{$return} : $scalar_return; } ); } =head1 SEE ALSO =over =item L =item L =back =cut 1; SQL-Translator-1.66/lib/SQL/Translator/Role/BuildArgs.pm0000644000000000000000000000122314701227332022702 0ustar00rootroot00000000000000package SQL::Translator::Role::BuildArgs; =head1 NAME SQL::Translator::Role::BuildArgs - Remove undefined constructor arguments =head1 SYNOPSIS package Foo; use Moo; with qw(SQL::Translator::Role::BuildArgs); =head1 DESCRIPTION This L wraps BUILDARGS to remove C constructor arguments for backwards compatibility with the old L-based L. =cut use Moo::Role; around BUILDARGS => sub { my $orig = shift; my $self = shift; my $args = $self->$orig(@_); foreach my $arg (keys %{$args}) { delete $args->{$arg} unless defined($args->{$arg}); } return $args; }; 1; SQL-Translator-1.66/lib/SQL/Translator/Role/Debug.pm0000644000000000000000000000141414701227332022056 0ustar00rootroot00000000000000package SQL::Translator::Role::Debug; use Moo::Role; use Sub::Quote qw(quote_sub); has _DEBUG => ( is => 'rw', accessor => 'debugging', init_arg => 'debugging', coerce => quote_sub(q{ $_[0] ? 1 : 0 }), lazy => 1, builder => 1, ); sub _build__DEBUG { my ($self) = @_; my $class = ref $self; no strict 'refs'; return ${"${class}::DEBUG"}; } around debugging => sub { my ($orig, $self) = (shift, shift); # Emulate horrible Class::Base API unless (ref $self) { my $dbgref = do { no strict 'refs'; \${"${self}::DEBUG"} }; $$dbgref = $_[0] if @_; return $$dbgref; } return $self->$orig(@_); }; sub debug { my $self = shift; return unless $self->debugging; print STDERR '[', (ref $self || $self), '] ', @_, "\n"; } 1; SQL-Translator-1.66/lib/SQL/Translator/Parser/0000755000000000000000000000000014716630506021034 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Parser/DBI/0000755000000000000000000000000014716630506021432 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Parser/DBI/MySQL.pm0000644000000000000000000000314314716630117022734 0ustar00rootroot00000000000000package SQL::Translator::Parser::DBI::MySQL; =head1 NAME SQL::Translator::Parser::DBI::MySQL - parser for DBD::mysql =head1 SYNOPSIS This module will be invoked automatically by SQL::Translator::Parser::DBI, so there is no need to use it directly. =head1 DESCRIPTION Uses SQL calls to query database directly for schema rather than parsing a create file. Should be much faster for larger schemas. =cut use strict; use warnings; use DBI; use Data::Dumper; use SQL::Translator::Schema::Constants; use SQL::Translator::Parser::MySQL; our ($DEBUG, @EXPORT_OK); our $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; sub parse { my ($tr, $dbh) = @_; my $schema = $tr->schema; my @table_names = @{ $dbh->selectcol_arrayref('show tables') }; my @skip_tables = defined $tr->parser_args->{skip} ? split(/,/, $tr->parser_args->{skip}) : (); $dbh->{'FetchHashKeyName'} = 'NAME_lc'; my $create = q{}; for my $table_name (@table_names) { next if (grep /^$table_name$/, @skip_tables); my $sth = $dbh->prepare("show create table " . $dbh->quote_identifier($table_name)); $sth->execute; my $table = $sth->fetchrow_hashref; $create .= ($table->{'create table'} || $table->{'create view'}) . ";\n\n"; } SQL::Translator::Parser::MySQL::parse($tr, $create); return 1; } 1; # ------------------------------------------------------------------- # Where man is not nature is barren. # William Blake # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =head1 SEE ALSO SQL::Translator. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm0000644000000000000000000002055214716630117023775 0ustar00rootroot00000000000000package SQL::Translator::Parser::DBI::PostgreSQL; =head1 NAME SQL::Translator::Parser::DBI::PostgreSQL - parser for DBD::Pg =head1 SYNOPSIS See SQL::Translator::Parser::DBI. =head1 DESCRIPTION Uses DBI to query PostgreSQL system tables to determine schema structure. =head1 CONFIGURATION You can specify the following for L : =head2 deconstruct_enum_types If set to a true value, the parser will look for column types which are user-defined Enums, and generate a column definition like: { data_type => 'enum', extra => { custom_type_name => 'MyEnumType', list => [ 'enum_val_1', 'enum_val_2', ... ], } } This makes a proper round-trip with SQL::Translator::Producer::PostgreSQL (which re-creates the custom enum type if C<< producer_args->{postgres_version} >= 8.003 >>) and can be translated to other engines. If the option is false (the default) you would just get { data_type => 'MyEnumType' } with no provided method to translate it to other SQL engines. =cut use strict; use warnings; use DBI; use Data::Dumper; use SQL::Translator::Schema::Constants; our ($DEBUG, @EXPORT_OK); our $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; my $actions = { c => 'cascade', r => 'restrict', a => 'no action', n => 'set null', d => 'set default', }; sub parse { my ($tr, $dbh) = @_; my $schema = $tr->schema; my $deconstruct_enum_types = $tr->parser_args->{deconstruct_enum_types}; my $column_select = $dbh->prepare( "SELECT a.attname, a.atttypid, t.typtype, format_type(t.oid, a.atttypmod) as typname, a.attnum, a.atttypmod as length, a.attnotnull, a.atthasdef, pg_get_expr(ad.adbin, ad.adrelid) as adsrc, d.description FROM pg_type t, pg_attribute a LEFT JOIN pg_attrdef ad ON (ad.adrelid = a.attrelid AND a.attnum = ad.adnum) LEFT JOIN pg_description d ON (a.attrelid=d.objoid AND a.attnum=d.objsubid) WHERE a.attrelid=? AND attnum>0 AND a.atttypid=t.oid ORDER BY a.attnum" ); my $index_select = $dbh->prepare( "SELECT oid, c.relname, i.indkey, i.indnatts, i.indisunique, i.indisprimary, pg_get_indexdef(oid) AS create_string FROM pg_class c,pg_index i WHERE c.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname='public') AND c.relkind='i' AND c.oid=i.indexrelid AND i.indrelid=?" ); my $table_select = $dbh->prepare( "SELECT c.oid, c.relname, d.description FROM pg_class c LEFT JOIN pg_description d ON c.oid=d.objoid AND d.objsubid=0 WHERE relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname='public') AND relkind='r';" ); my $fk_select = $dbh->prepare( q/ SELECT r.conname, c.relname, d.relname AS frelname, r.conkey, ARRAY(SELECT column_name::varchar FROM information_schema.columns WHERE ordinal_position = ANY (r.conkey) AND table_schema = n.nspname AND table_name = c.relname ) AS fields, r.confkey, ARRAY(SELECT column_name::varchar FROM information_schema.columns WHERE ordinal_position = ANY (r.confkey) AND table_schema = n.nspname AND table_name = d.relname ) AS reference_fields, r.confupdtype, r.confdeltype, r.confmatchtype FROM pg_catalog.pg_constraint r JOIN pg_catalog.pg_class c ON c.oid = r.conrelid AND r.contype = 'f' JOIN pg_catalog.pg_class d ON d.oid = r.confrelid JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE pg_catalog.pg_table_is_visible(c.oid) AND n.nspname = ? AND c.relname = ? ORDER BY 1; / ) or die "Can't prepare: $@"; my %enum_types; if ($deconstruct_enum_types) { my $enum_select = $dbh->prepare('SELECT enumtypid, enumlabel FROM pg_enum ORDER BY oid, enumsortorder') or die "Can't prepare: $@"; $enum_select->execute(); while (my $enumval = $enum_select->fetchrow_hashref) { push @{ $enum_types{ $enumval->{enumtypid} } }, $enumval->{enumlabel}; } } $table_select->execute(); while (my $tablehash = $table_select->fetchrow_hashref) { my $table_name = $$tablehash{'relname'}; my $table_oid = $$tablehash{'oid'}; my $table = $schema->add_table( name => $table_name, #what is type? type => $table_info->{TABLE_TYPE}, ) || die $schema->error; $table->comments($$tablehash{'description'}) if $$tablehash{'description'}; $column_select->execute($table_oid); my %column_by_attrid; while (my $columnhash = $column_select->fetchrow_hashref) { my $type = $$columnhash{'typname'}; # For the case of character varying(50), atttypmod will be 54 and the (50) # will be listed as part of the type. For numeric(8,5) the atttypmod will # be a meaningless large number. To make this compatible with the # rest of SQL::Translator, remove the size from the type and change the # size to whatever was removed from the type. my @size = ($type =~ s/\(([0-9,]+)\)$//) ? (split /,/, $1) : (); my $col = $table->add_field( name => $$columnhash{'attname'}, data_type => $type, order => $$columnhash{'attnum'}, ) || die $table->error; $col->size(\@size) if @size; # default values are a DDL expression. Convert the obvious ones like '...'::text # to a plain value and let the rest be scalarrefs. my $default = $$columnhash{'adsrc'}; if (defined $default) { if ($default =~ /^[0-9.]+$/) { $col->default_value($default) } elsif ($default =~ /^'(.*?)'(::\Q$type\E)?$/) { my $str = $1; $str =~ s/''/'/g; $col->default_value($str); } else { $col->default_value(\$default); } } if ( $deconstruct_enum_types && $enum_types{ $columnhash->{atttypid} }) { $col->extra->{custom_type_name} = $col->data_type; $col->extra->{list} = [ @{ $enum_types{ $columnhash->{atttypid} } } ]; $col->data_type('enum'); } $col->is_nullable($$columnhash{'attnotnull'} ? 0 : 1); $col->comments($$columnhash{'description'}) if $$columnhash{'description'}; $column_by_attrid{ $$columnhash{'attnum'} } = $$columnhash{'attname'}; } $index_select->execute($table_oid); while (my $indexhash = $index_select->fetchrow_hashref) { #don't deal with function indexes at the moment next if ($$indexhash{'indkey'} eq '' or !defined($$indexhash{'indkey'})); my @columns = map $column_by_attrid{$_}, split /\s+/, $$indexhash{'indkey'}; my $type; if ($$indexhash{'indisprimary'}) { $type = UNIQUE; #PRIMARY_KEY; #tell sqlt that this is the primary key: for my $column (@columns) { $table->get_field($column)->{is_primary_key} = 1; } } elsif ($$indexhash{'indisunique'}) { $type = UNIQUE; } else { $type = NORMAL; } $table->add_index( name => $$indexhash{'relname'}, type => $type, fields => \@columns, ) || die $table->error; } $fk_select->execute('public', $table_name) or die "Can't execute: $@"; my $fkeys = $fk_select->fetchall_arrayref({}); $DEBUG and print Dumper $fkeys; for my $con (@$fkeys) { my $con_name = $con->{conname}; my $fields = $con->{fields}; my $reference_fields = $con->{reference_fields}; my $reference_table = $con->{frelname}; my $on_upd = $con->{confupdtype}; my $on_del = $con->{confdeltype}; $table->add_constraint( name => $con_name, type => 'foreign_key', fields => $fields, reference_fields => $reference_fields, reference_table => $reference_table, on_update => $actions->{$on_upd}, on_delete => $actions->{$on_del}, ); } } return 1; } 1; # ------------------------------------------------------------------- # Time is a waste of money. # Oscar Wilde # ------------------------------------------------------------------- =pod =head1 AUTHOR Scott Cain Ecain@cshl.eduE, previous author: Paul Harrington Eharringp@deshaw.comE. =head1 SEE ALSO SQL::Translator, DBD::Pg. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/DBI/Sybase.pm0000644000000000000000000001614014716630117023216 0ustar00rootroot00000000000000package SQL::Translator::Parser::DBI::Sybase; =head1 NAME SQL::Translator::Parser::DBI::Sybase - parser for DBD::Sybase =head1 SYNOPSIS See SQL::Translator::Parser::DBI. =head1 DESCRIPTION Uses DBI Catalog Methods. =cut use strict; use warnings; use DBI; use SQL::Translator::Schema; use Data::Dumper; our ($DEBUG, @EXPORT_OK); our $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; no strict 'refs'; sub parse { my ($tr, $dbh) = @_; if ($dbh->{FetchHashKeyName} ne 'NAME_uc') { warn "setting dbh attribute {FetchHashKeyName} to NAME_uc"; $dbh->{FetchHashKeyName} = 'NAME_uc'; } if ($dbh->{ChopBlanks} != 1) { warn "setting dbh attribute {ChopBlanks} to 1"; $dbh->{ChopBlanks} = 1; } my $schema = $tr->schema; my ($sth, @tables, $columns); my $stuff; ### Columns # it is much quicker to slurp back everything all at once rather # than make repeated calls $sth = $dbh->column_info(undef, undef, undef, undef); foreach my $c (@{ $sth->fetchall_arrayref({}) }) { $columns->{ $c->{TABLE_CAT} }->{ $c->{TABLE_SCHEM} } ->{ $c->{TABLE_NAME} }->{columns}->{ $c->{COLUMN_NAME} } = $c; } ### Tables and views # Get a list of the tables and views. $sth = $dbh->table_info(); @tables = @{ $sth->fetchall_arrayref({}) }; my $h = $dbh->selectall_arrayref( q{ SELECT o.name, colid,colid2,c.text FROM syscomments c JOIN sysobjects o ON c.id = o.id WHERE o.type ='V' ORDER BY o.name, c.colid, c.colid2 } ); # View text # I had always thought there was something 'hard' about # reconstructing text from syscomments .. # this seems to work fine and is certainly not complicated! foreach (@{$h}) { $stuff->{view}->{ $_->[0] }->{text} .= $_->[3]; } #### objects with indexes. map { $stuff->{indexes}->{ $_->[0] }++ if defined; } @{ $dbh->selectall_arrayref( "SELECT DISTINCT object_name(id) AS name FROM sysindexes WHERE indid > 0" ) }; ## slurp objects map { $stuff->{ $_->[1] }->{ $_->[0] } = $_; } @{ $dbh->selectall_arrayref("SELECT name,type, id FROM sysobjects") }; ### Procedures # This gets legitimate procedures by used the 'supported' API: sp_stored_procedures map { my $n = $_->{PROCEDURE_NAME}; $n =~ s/;\d+$//; # Ignore versions for now $_->{name} = $n; $stuff->{procedures}->{$n} = $_; } values %{ $dbh->selectall_hashref("sp_stored_procedures", 'PROCEDURE_NAME') }; # And this blasts in the text of 'legit' stored procedures. Do # this rather than calling sp_helptext in a loop. $h = $dbh->selectall_arrayref( q{ SELECT o.name, colid,colid2,c.text FROM syscomments c JOIN sysobjects o ON c.id = o.id WHERE o.type ='P' ORDER BY o.name, c.colid, c.colid2 } ); foreach (@{$h}) { $stuff->{procedures}->{ $_->[0] }->{text} .= $_->[3] if (defined($stuff->{procedures}->{ $_->[0] })); } ### Defaults ### Rules ### Bind Defaults ### Bind Rules ### Triggers # Since the 'target' of the trigger is defined in the text, we will # just create them independently for now rather than associating them # with a table. $h = $dbh->selectall_arrayref( q{ SELECT o.name, colid,colid2,c.text FROM syscomments c JOIN sysobjects o ON c.id = o.id JOIN sysobjects o1 ON (o.id = o1.instrig OR o.id = o1.deltrig or o.id = o1.updtrig) WHERE o.type ='TR' ORDER BY o.name, c.colid, c.colid2 } ); foreach (@{$h}) { $stuff->{triggers}->{ $_->[0] }->{text} .= $_->[3]; } ### References ### Keys ### Types # Not sure what to do with these? $stuff->{type_info_all} = $dbh->type_info_all; ### Tables # According to the DBI docs, these can be # "TABLE" # "VIEW" # "SYSTEM TABLE" # "GLOBAL TEMPORARY", # "LOCAL TEMPORARY" # "ALIAS" # "SYNONYM" foreach my $table_info (@tables) { next unless (defined($table_info->{TABLE_TYPE})); if ($table_info->{TABLE_TYPE} =~ /TABLE/) { my $table = $schema->add_table( name => $table_info->{TABLE_NAME}, type => $table_info->{TABLE_TYPE}, ) || die $schema->error; # find the associated columns my $cols = $columns->{ $table_info->{TABLE_QUALIFIER} } ->{ $table_info->{TABLE_OWNER} }->{ $table_info->{TABLE_NAME} } ->{columns}; foreach my $c (values %{$cols}) { my $f = $table->add_field( name => $c->{COLUMN_NAME}, data_type => $c->{TYPE_NAME}, order => $c->{ORDINAL_POSITION}, size => $c->{COLUMN_SIZE}, ) || die $table->error; $f->is_nullable(1) if ($c->{NULLABLE} == 1); } # add in primary key my $h = $dbh->selectall_hashref( "sp_pkeys [$table_info->{TABLE_NAME}]", 'COLUMN_NAME' ); if (scalar keys %{$h} > 1) { my @c = map { $_->{COLUMN_NAME} } sort { $a->{KEY_SEQ} <=> $b->{KEY_SEQ} } values %{$h}; $table->primary_key(@c) if (scalar @c); } # add in any indexes ... how do we tell if the index has # already been created as part of a primary key or other # constraint? if (defined($stuff->{indexes}->{ $table_info->{TABLE_NAME} })) { my $h = $dbh->selectall_hashref( "sp_helpindex [$table_info->{TABLE_NAME}]", 'INDEX_NAME' ); foreach (values %{$h}) { my $fields = $_->{'INDEX_KEYS'}; $fields =~ s/\s*//g; my $i = $table->add_index( name => $_->{INDEX_NAME}, fields => $fields, ); if ($_->{'INDEX_DESCRIPTION'} =~ /unique/i) { $i->type('unique'); # we could make this a primary key if there # isn't already one defined and if there # aren't any nullable columns in thisindex. if (!defined($table->primary_key())) { $table->primary_key($fields) unless grep { $table->get_field($_)->is_nullable() } split(/,\s*/, $fields); } } } } } elsif ($table_info->{TABLE_TYPE} eq 'VIEW') { my $view = $schema->add_view(name => $table_info->{TABLE_NAME},); my $cols = $columns->{ $table_info->{TABLE_QUALIFIER} } ->{ $table_info->{TABLE_OWNER} }->{ $table_info->{TABLE_NAME} } ->{columns}; $view->fields( map { $_->{COLUMN_NAME} } sort { $a->{ORDINAL_POSITION} <=> $b->{ORDINAL_POSITION} } values %{$cols} ); $view->sql($stuff->{view}->{ $table_info->{TABLE_NAME} }->{text}) if (defined($stuff->{view}->{ $table_info->{TABLE_NAME} }->{text})); } } foreach my $p (values %{ $stuff->{procedures} }) { my $proc = $schema->add_procedure( name => $p->{name}, owner => $p->{PROCEDURE_OWNER}, comments => $p->{REMARKS}, sql => $p->{text}, ); } ### Permissions ### Groups ### Users ### Aliases ### Logins return 1; } 1; =pod =head1 AUTHOR Paul Harrington Eharringp@deshaw.comE. =head1 SEE ALSO DBI, DBD::Sybase, SQL::Translator::Schema. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/DBI/DB2.pm0000644000000000000000000001436114716630117022342 0ustar00rootroot00000000000000package SQL::Translator::Parser::DBI::DB2; =head1 NAME SQL::Translator::Parser::DBI::DB2 - parser for DBD::DB2 =head1 SYNOPSIS See SQL::Translator::Parser::DBI. =head1 DESCRIPTION Uses DBI methods to determine schema structure. DBI, of course, delegates to DBD::DB2. =cut use strict; use warnings; use DBI; use Data::Dumper; use SQL::Translator::Parser::DB2; use SQL::Translator::Schema::Constants; our ($DEBUG, $VERSION, @EXPORT_OK); # $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; sub parse { my ($tr, $dbh) = @_; my $schema = $tr->schema; my ($sth, @tables, $columns); my $stuff; if ($dbh->{FetchHashKeyName} ne 'NAME_uc') { $dbh->{FetchHashKeyName} = 'NAME_uc'; } if ($dbh->{ChopBlanks} != 1) { $dbh->{ChopBlanks} = 1; } my $tabsth = $dbh->prepare(<table_info(); # @tables = @{$sth->fetchall_arrayref({})}; my $colsth = $dbh->prepare(<prepare(<prepare(< 'P' AND i.TABNAME = ? SQL my $trigsth = $dbh->prepare(<execute(); @tables = @{ $tabsth->fetchall_arrayref({}) }; foreach my $table_info (@tables) { next unless (defined($table_info->{TYPE})); # Why are we not getting system tables, maybe a parameter should decide? if ( $table_info->{TYPE} eq 'T' && $table_info->{TABSCHEMA} !~ /^SYS/) { print Dumper($table_info) if ($DEBUG); print $table_info->{TABNAME} if ($DEBUG); my $table = $schema->add_table( name => $table_info->{TABNAME}, type => 'TABLE', ) || die $schema->error; $table->options("TABLESPACE", $table_info->{TBSPACE}); $colsth->execute($table_info->{TABNAME}); my $cols = $colsth->fetchall_hashref("COLNAME"); foreach my $c (values %{$cols}) { print Dumper($c) if $DEBUG; print $c->{COLNAME} if ($DEBUG); my $f = $table->add_field( name => $c->{COLNAME}, default_value => $c->{DEFAULT}, data_type => $c->{TYPENAME}, order => $c->{COLNO}, size => $c->{LENGTH}, ) || die $table->error; $f->is_nullable($c->{NULLS} eq 'Y'); } $consth->execute($table_info->{TABNAME}); my $cons = $consth->fetchall_hashref("COLNAME"); next if (!%$cons); my @fields = map { $_->{COLNAME} } (values %{$cons}); my $c = $cons->{ $fields[0] }; print $c->{CONSTNAME} if ($DEBUG); my $con = $table->add_constraint( name => $c->{CONSTNAME}, fields => \@fields, type => $c->{TYPE} eq 'P' ? PRIMARY_KEY : $c->{TYPE} eq 'F' ? FOREIGN_KEY : UNIQUE ) || die $table->error; $con->deferrable($c->{CHECKEXISTINGDATA} eq 'D'); $indsth->execute($table_info->{TABNAME}); my $inds = $indsth->fetchall_hashref("INDNAME"); print Dumper($inds) if ($DEBUG); next if (!%$inds); foreach my $ind (keys %$inds) { print $ind if ($DEBUG); $indsth->execute($table_info->{TABNAME}); my $indcols = $indsth->fetchall_hashref("COLNAME"); next if ($inds->{$ind}{UNIQUERULE} eq 'P'); print Dumper($indcols) if ($DEBUG); my @fields = map { $_->{INDNAME} eq $ind ? $_->{COLNAME} : () } (values %{$indcols}); my $index = $indcols->{ $fields[0] }; my $inew = $table->add_index( name => $index->{INDNAME}, fields => \@fields, type => $index->{UNIQUERULE} eq 'U' ? UNIQUE : NORMAL ) || die $table->error; } $trigsth->execute($table_info->{TABNAME}); my $trigs = $trigsth->fetchall_hashref("TRIGNAME"); print Dumper($trigs); next if (!%$trigs); foreach my $t (values %$trigs) { print $t->{TRIGNAME} if ($DEBUG); my $trig = $schema->add_trigger( name => $t->{TRIGNAME}, # fields => \@fields, perform_action_when => $t->{TRIGTIME} eq 'A' ? 'after' : $t->{TRIGTIME} eq 'B' ? 'before' : 'instead', database_event => $t->{TRIGEVENT} eq 'I' ? 'insert' : $t->{TRIGEVENT} eq 'D' ? 'delete' : 'update', action => $t->{TEXT}, on_table => $t->{TABNAME} ) || die $schema->error; # $trig->extra( reference => $def->{'reference'}, # condition => $def->{'condition'}, # granularity => $def->{'granularity'} ); } } } return 1; } 1; # ------------------------------------------------------------------- # Time is a waste of money. # Oscar Wilde # ------------------------------------------------------------------- =pod =head1 AUTHOR Jess Robinson castaway@desert-island.m.isar.de. =head1 SEE ALSO SQL::Translator, DBD::DB2. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/DBI/SQLServer.pm0000644000000000000000000002074614716630117023625 0ustar00rootroot00000000000000package SQL::Translator::Parser::DBI::SQLServer; =head1 NAME SQL::Translator::Parser::DBI::SQLServer - parser for SQL Server through DBD::ODBC =head1 SYNOPSIS See SQL::Translator::Parser::DBI. =head1 DESCRIPTION Uses DBI Catalog Methods. =cut use strict; use warnings; use DBI; use SQL::Translator::Schema; use Data::Dumper; our ($DEBUG, @EXPORT_OK); our $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; no strict 'refs'; sub parse { my ($tr, $dbh) = @_; if ($dbh->{FetchHashKeyName} ne 'NAME_uc') { warn "setting dbh attribute {FetchHashKeyName} to NAME_uc"; $dbh->{FetchHashKeyName} = 'NAME_uc'; } if ($dbh->{ChopBlanks} != 1) { warn "setting dbh attribute {ChopBlanks} to 1"; $dbh->{ChopBlanks} = 1; } my $schema = $tr->schema; my ($sth, @tables, $columns); my $stuff; ### Columns # it is much quicker to slurp back everything all at once rather # than make repeated calls $sth = $dbh->column_info(undef, undef, undef, undef); foreach my $c (@{ $sth->fetchall_arrayref({}) }) { $columns->{ $c->{TABLE_CAT} }->{ $c->{TABLE_SCHEM} } ->{ $c->{TABLE_NAME} }->{columns}->{ $c->{COLUMN_NAME} } = $c; } ### Tables and views # Get a list of the tables and views. $sth = $dbh->table_info(); @tables = @{ $sth->fetchall_arrayref({}) }; my $h = $dbh->selectall_arrayref( q{ SELECT o.name, colid,c.text FROM syscomments c JOIN sysobjects o ON c.id = o.id WHERE o.type ='V' ORDER BY o.name, c.colid } ); # View text # I had always thought there was something 'hard' about # reconstructing text from syscomments .. # this seems to work fine and is certainly not complicated! foreach (@{$h}) { $stuff->{view}->{ $_->[0] }->{text} .= $_->[2]; } #### objects with indexes. map { $stuff->{indexes}->{ $_->[0] }++ if defined; } @{ $dbh->selectall_arrayref( "SELECT DISTINCT object_name(id) FROM sysindexes WHERE indid > 0 and indid < 255 and name not like '_WA_Sys%'" ) }; ## slurp objects map { $stuff->{ $_->[1] }->{ $_->[0] } = $_; } @{ $dbh->selectall_arrayref("SELECT name,type, id FROM sysobjects") }; ### Procedures # This gets legitimate procedures by used the 'supported' API: sp_stored_procedures map { my $n = $_->{PROCEDURE_NAME}; $n =~ s/;\d+$//; # Ignore versions for now $_->{name} = $n; $stuff->{procedures}->{$n} = $_; } values %{ $dbh->selectall_hashref("sp_stored_procedures", 'PROCEDURE_NAME') }; # And this blasts in the text of 'legit' stored procedures. Do # this rather than calling sp_helptext in a loop. $h = $dbh->selectall_arrayref( q{ SELECT o.name, colid,c.text FROM syscomments c JOIN sysobjects o ON c.id = o.id WHERE o.type in ('P', 'FN', 'TF', 'IF') } ); foreach (@{$h}) { $stuff->{procedures}->{ $_->[0] }->{text} .= $_->[2] if (defined($stuff->{procedures}->{ $_->[0] })); } ### Defaults ### Rules ### Bind Defaults ### Bind Rules ### Triggers # Since the 'target' of the trigger is defined in the text, we will # just create them independently for now rather than associating them # with a table. $h = $dbh->selectall_arrayref( q{ SELECT o.name, colid,c.text FROM syscomments c JOIN sysobjects o ON c.id = o.id JOIN sysobjects o1 ON (o.id = o1.instrig OR o.id = o1.deltrig or o.id = o1.updtrig) WHERE o.type ='TR' ORDER BY o.name, c.colid } ); foreach (@{$h}) { $stuff->{triggers}->{ $_->[0] }->{text} .= $_->[2]; } ### References ### Keys ### Types # Not sure what to do with these? $stuff->{type_info_all} = $dbh->type_info_all; ### Tables # According to the DBI docs, these can be # "TABLE" # "VIEW" # "SYSTEM TABLE" # "GLOBAL TEMPORARY", # "LOCAL TEMPORARY" # "ALIAS" # "SYNONYM" foreach my $table_info (@tables) { next unless (defined($table_info->{TABLE_TYPE})); if ($table_info->{TABLE_TYPE} eq "TABLE") { my $table = $schema->add_table( name => $table_info->{TABLE_NAME}, type => $table_info->{TABLE_TYPE}, ) || die $schema->error; # find the associated columns my $cols = $columns->{ $table_info->{TABLE_CAT} } ->{ $table_info->{TABLE_SCHEM} }->{ $table_info->{TABLE_NAME} } ->{columns}; foreach my $c (values %{$cols}) { my $is_auto_increment = $c->{TYPE_NAME} =~ s#(\(\))? identity##i; my $f = $table->add_field( name => $c->{COLUMN_NAME}, data_type => $c->{TYPE_NAME}, order => $c->{ORDINAL_POSITION}, size => [ $c->{COLUMN_SIZE}, $c->{DECIMAL_DIGITS} ], ) || die $table->error; $f->is_nullable($c->{NULLABLE} == 1); $f->is_auto_increment($is_auto_increment); if (defined $c->{COLUMN_DEF}) { $c->{COLUMN_DEF} =~ s#\('?(.*?)'?\)#$1#; $f->default_value($c->{COLUMN_DEF}); } } # add in primary key my $h = $dbh->selectall_hashref( "sp_pkeys [$table_info->{TABLE_NAME}]", 'COLUMN_NAME' ); if (scalar keys %{$h} >= 1) { my @c = map { $_->{COLUMN_NAME} } sort { $a->{KEY_SEQ} <=> $b->{KEY_SEQ} } values %{$h}; $table->primary_key(@c) if (scalar @c); } # add in foreign keys $h = $dbh->selectall_hashref( "sp_fkeys NULL, \@fktable_name = '[$table_info->{TABLE_NAME}]'", 'FK_NAME' ); foreach my $fk (values %{$h}) { my $constraint = $table->add_constraint( name => $fk->{FK_NAME}, fields => [ $fk->{FKCOLUMN_NAME} ], ); $constraint->type("FOREIGN_KEY"); $constraint->on_delete( $fk->{DELETE_RULE} == 0 ? "CASCADE" : $fk->{DELETE_RULE} == 1 ? "NO ACTION" : "SET_NULL" ); $constraint->on_update( $fk->{UPDATE_RULE} == 0 ? "CASCADE" : $fk->{UPDATE_RULE} == 1 ? "NO ACTION" : "SET_NULL" ); $constraint->reference_table($fk->{PKTABLE_NAME}); } # add in any indexes ... how do we tell if the index has # already been created as part of a primary key or other # constraint? if (defined($stuff->{indexes}->{ $table_info->{TABLE_NAME} })) { my $h = $dbh->selectall_hashref( "sp_helpindex [$table_info->{TABLE_NAME}]", 'INDEX_NAME' ); foreach (values %{$h}) { my $fields = $_->{'INDEX_KEYS'}; $fields =~ s/\s*//g; my $i = $table->add_index( name => $_->{INDEX_NAME}, fields => $fields, ); if ($_->{'INDEX_DESCRIPTION'} =~ /unique/i) { $i->type('unique'); # we could make this a primary key if there # isn't already one defined and if there # aren't any nullable columns in thisindex. if (!defined($table->primary_key())) { $table->primary_key($fields) unless grep { $table->get_field($_)->is_nullable() } split(/,\s*/, $fields); } } } } } elsif ($table_info->{TABLE_TYPE} eq 'VIEW') { next if $table_info->{TABLE_NAME} eq 'sysconstraints' || $table_info->{TABLE_NAME} eq 'syssegments'; next if !$stuff->{view}->{ $table_info->{TABLE_NAME} }->{text}; my $view = $schema->add_view(name => $table_info->{TABLE_NAME},); my $cols = $columns->{ $table_info->{TABLE_CAT} } ->{ $table_info->{TABLE_SCHEM} }->{ $table_info->{TABLE_NAME} } ->{columns}; $view->fields( map { $_->{COLUMN_NAME} } sort { $a->{ORDINAL_POSITION} <=> $b->{ORDINAL_POSITION} } values %{$cols} ); $view->sql($stuff->{view}->{ $table_info->{TABLE_NAME} }->{text}) if (defined($stuff->{view}->{ $table_info->{TABLE_NAME} }->{text})); } } foreach my $p (values %{ $stuff->{procedures} }) { next if !$p->{text}; my $proc = $schema->add_procedure( name => $p->{name}, owner => $p->{PROCEDURE_OWNER}, comments => $p->{REMARKS}, sql => $p->{text}, ); } ### Permissions ### Groups ### Users ### Aliases ### Logins return 1; } 1; =pod =head1 AUTHOR Chris Hilton Echris@dctank.comE - Bulk of code from DBI-Sybase parser, I just tweaked it for SQLServer. Thanks. =head1 SEE ALSO DBI, DBD::ODBC, SQL::Translator::Schema. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/DBI/Oracle.pm0000644000000000000000000000642114716630117023176 0ustar00rootroot00000000000000package SQL::Translator::Parser::DBI::Oracle; =head1 NAME SQL::Translator::Parser::DBI::Oracle - parser for DBD::Oracle =head1 SYNOPSIS See SQL::Translator::Parser::DBI. =head1 DESCRIPTION Uses DBI introspection methods to determine schema details. =cut use strict; use warnings; use DBI; use SQL::Translator::Schema::Constants; use SQL::Translator::Schema::Table; use SQL::Translator::Schema::Field; use SQL::Translator::Schema::Constraint; our $VERSION = '1.66'; sub parse { my ($tr, $dbh) = @_; my $schema = $tr->schema; my $db_user = uc $tr->parser_args()->{db_user}; my $sth = $dbh->table_info(undef, $db_user, '%', 'TABLE'); while (my $table_info = $sth->fetchrow_hashref('NAME_uc')) { next if ($table_info->{TABLE_NAME} =~ /\$/); # create the table my $table = $schema->add_table( name => $table_info->{TABLE_NAME}, type => $table_info->{TABLE_TYPE}, ); # add the fields (columns) for this table my $sth; $sth = $dbh->column_info(undef, $table_info->{TABLE_SCHEM}, $table_info->{TABLE_NAME}, '%'); while (my $column = $sth->fetchrow_hashref('NAME_uc')) { my $f = $table->add_field( name => $column->{COLUMN_NAME}, default_value => $column->{COLUMN_DEF}, data_type => $column->{TYPE_NAME}, order => $column->{ORDINAL_POSITION}, size => $column->{COLUMN_SIZE}, ) || die $table->error; $f->is_nullable($column->{NULLABLE} == 1); } # add the primary key info $sth = $dbh->primary_key_info(undef, $table_info->{TABLE_SCHEM}, $table_info->{TABLE_NAME},); while (my $primary_key = $sth->fetchrow_hashref('NAME_uc')) { my $f = $table->get_field($primary_key->{COLUMN_NAME}); $f->is_primary_key(1); } # add the foreign key info (constraints) $sth = $dbh->foreign_key_info(undef, undef, undef, undef, $table_info->{TABLE_SCHEM}, $table_info->{TABLE_NAME},); my $cons = {}; while (my $foreign_key = $sth->fetchrow_hashref('NAME_uc')) { my $name = $foreign_key->{FK_NAME}; $cons->{$name}->{reference_table} = $foreign_key->{UK_TABLE_NAME}; push @{ $cons->{$name}->{fields} }, $foreign_key->{FK_COLUMN_NAME}; push @{ $cons->{$name}->{reference_fields} }, $foreign_key->{UK_COLUMN_NAME}; } for my $name (keys %$cons) { my $c = $table->add_constraint( type => FOREIGN_KEY, name => $name, fields => $cons->{$name}->{fields}, reference_fields => $cons->{$name}->{reference_fields}, reference_table => $cons->{$name}->{reference_table}, ) || die $table->error; } } return 1; } 1; =pod =head1 AUTHOR Earl Cahill Ecpan@spack.netE. =head1 ACKNOWLEDGEMENT Initial revision of this module came almost entirely from work done by Todd Hepler Ethepler@freeshell.orgE. My changes were quite minor (ensuring NAME_uc, changing a couple variable names, skipping tables with a $ in them). Todd claimed his work to be an almost verbatim copy of SQL::Translator::Parser::DBI::PostgreSQL revision 1.7 For me, the real work happens in DBD::Oracle and DBI, which, also for me, that is the beauty of having introspection methods in DBI. =head1 SEE ALSO SQL::Translator, DBD::Oracle. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/DBI/SQLite.pm0000644000000000000000000000254514716630117023135 0ustar00rootroot00000000000000package SQL::Translator::Parser::DBI::SQLite; =head1 NAME SQL::Translator::Parser::DBI::SQLite - parser for DBD::SQLite =head1 SYNOPSIS See SQL::Translator::Parser::DBI. =head1 DESCRIPTION Queries the "sqlite_master" table for schema definition. The schema is held in this table simply as CREATE statements for the database objects, so it really just builds up a string of all these and passes the result to the regular SQLite parser. Therefore there is no gain (at least in performance) to using this module over simply dumping the schema to a text file and parsing that. =cut use strict; use warnings; use DBI; use SQL::Translator::Parser::SQLite; use Data::Dumper; our ($DEBUG, @EXPORT_OK); our $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; sub parse { my ($tr, $dbh) = @_; my $create = join(";\n", map { $_ || () } @{ $dbh->selectcol_arrayref('select sql from sqlite_master') },); $create .= ";"; $tr->debug("create =\n$create\n"); my $schema = $tr->schema; SQL::Translator::Parser::SQLite::parse($tr, $create); return 1; } 1; # ------------------------------------------------------------------- # Where man is not nature is barren. # William Blake # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Y. Clark Ekclark@cpan.orgE. =head1 SEE ALSO SQL::Translator::Parser::SQLite. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/JSON.pm0000644000000000000000000000646214716630117022151 0ustar00rootroot00000000000000package SQL::Translator::Parser::JSON; use strict; use warnings; our $VERSION = '1.66'; use SQL::Translator::Schema; use SQL::Translator::Utils qw(header_comment); use Data::Dumper; use JSON::MaybeXS 'from_json'; sub parse { my ($translator, $data) = @_; $data = from_json($data); $data = $data->{'schema'}; warn "JSON data:", Dumper($data) if $translator->debug; my $schema = $translator->schema; # # Tables # my @tables = map { $data->{'tables'}{ $_->[1] } } sort { $a->[0] <=> $b->[0] } map { [ $data->{'tables'}{$_}{'order'} || 0, $_ ] } keys %{ $data->{'tables'} }; for my $tdata (@tables) { my $table = $schema->add_table(map { $tdata->{$_} ? ($_ => $tdata->{$_}) : () } (qw/name extra options/)) or die $schema->error; my @fields = map { $tdata->{'fields'}{ $_->[1] } } sort { $a->[0] <=> $b->[0] } map { [ $tdata->{'fields'}{$_}{'order'}, $_ ] } keys %{ $tdata->{'fields'} }; for my $fdata (@fields) { $table->add_field(%$fdata) or die $table->error; $table->primary_key($fdata->{'name'}) if $fdata->{'is_primary_key'}; } for my $idata (@{ $tdata->{'indices'} || [] }) { $table->add_index(%$idata) or die $table->error; } for my $cdata (@{ $tdata->{'constraints'} || [] }) { $table->add_constraint(%$cdata) or die $table->error; } $table->comments($tdata->{'comments'}) if exists $tdata->{'comments'}; } # # Views # my @views = map { $data->{'views'}{ $_->[1] } } sort { $a->[0] <=> $b->[0] } map { [ $data->{'views'}{$_}{'order'}, $_ ] } keys %{ $data->{'views'} }; for my $vdata (@views) { $schema->add_view(%$vdata) or die $schema->error; } # # Triggers # my @triggers = map { $data->{'triggers'}{ $_->[1] } } sort { $a->[0] <=> $b->[0] } map { [ $data->{'triggers'}{$_}{'order'}, $_ ] } keys %{ $data->{'triggers'} }; for my $tdata (@triggers) { $schema->add_trigger(%$tdata) or die $schema->error; } # # Procedures # my @procedures = map { $data->{'procedures'}{ $_->[1] } } sort { $a->[0] <=> $b->[0] } map { [ $data->{'procedures'}{$_}{'order'}, $_ ] } keys %{ $data->{'procedures'} }; for my $tdata (@procedures) { $schema->add_procedure(%$tdata) or die $schema->error; } if (my $tr_data = $data->{'translator'}) { $translator->add_drop_table($tr_data->{'add_drop_table'}); $translator->filename($tr_data->{'filename'}); $translator->no_comments($tr_data->{'no_comments'}); $translator->parser_args($tr_data->{'parser_args'}); $translator->producer_args($tr_data->{'producer_args'}); $translator->parser_type($tr_data->{'parser_type'}); $translator->producer_type($tr_data->{'producer_type'}); $translator->show_warnings($tr_data->{'show_warnings'}); $translator->trace($tr_data->{'trace'}); } return 1; } 1; __END__ =head1 NAME SQL::Translator::Parser::JSON - Parse a JSON representation of a schema =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new(parser => "JSON"); =head1 DESCRIPTION C parses a schema serialized with JSON. =head1 AUTHORS Darren Chamberlain Edarren@cpan.orgE, Ken Y. Clark Ekclark@cpan.orgE. Jon Jensen Ejonj@cpan.orgE. SQL-Translator-1.66/lib/SQL/Translator/Parser/MySQL.pm0000644000000000000000000007762414716630117022355 0ustar00rootroot00000000000000package SQL::Translator::Parser::MySQL; =head1 NAME SQL::Translator::Parser::MySQL - parser for MySQL =head1 SYNOPSIS use SQL::Translator; use SQL::Translator::Parser::MySQL; my $translator = SQL::Translator->new; $translator->parser("SQL::Translator::Parser::MySQL"); =head1 DESCRIPTION The grammar is influenced heavily by Tim Bunce's "mysql2ora" grammar. Here's the word from the MySQL site (http://www.mysql.com/doc/en/CREATE_TABLE.html): CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)] [table_options] [select_statement] or CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name LIKE old_table_name; create_definition: col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT] [PRIMARY KEY] [reference_definition] or PRIMARY KEY (index_col_name,...) or KEY [index_name] (index_col_name,...) or INDEX [index_name] (index_col_name,...) or UNIQUE [INDEX] [index_name] (index_col_name,...) or FULLTEXT [INDEX] [index_name] (index_col_name,...) or [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name,...) [reference_definition] or CHECK (expr) type: TINYINT[(length)] [UNSIGNED] [ZEROFILL] or SMALLINT[(length)] [UNSIGNED] [ZEROFILL] or MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL] or INT[(length)] [UNSIGNED] [ZEROFILL] or INTEGER[(length)] [UNSIGNED] [ZEROFILL] or BIGINT[(length)] [UNSIGNED] [ZEROFILL] or REAL[(length,decimals)] [UNSIGNED] [ZEROFILL] or DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL] or FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL] or DECIMAL(length,decimals) [UNSIGNED] [ZEROFILL] or NUMERIC(length,decimals) [UNSIGNED] [ZEROFILL] or CHAR(length) [BINARY] or VARCHAR(length) [BINARY] or DATE or TIME or TIMESTAMP or DATETIME or TINYBLOB or BLOB or MEDIUMBLOB or LONGBLOB or TINYTEXT or TEXT or MEDIUMTEXT or LONGTEXT or ENUM(value1,value2,value3,...) or SET(value1,value2,value3,...) index_col_name: col_name [(length)] reference_definition: REFERENCES tbl_name [(index_col_name,...)] [MATCH FULL | MATCH PARTIAL] [ON DELETE reference_option] [ON UPDATE reference_option] reference_option: RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT table_options: TYPE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM } or ENGINE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM } or AUTO_INCREMENT = # or AVG_ROW_LENGTH = # or [ DEFAULT ] CHARACTER SET charset_name or CHECKSUM = {0 | 1} or COLLATE collation_name or COMMENT = "string" or MAX_ROWS = # or MIN_ROWS = # or PACK_KEYS = {0 | 1 | DEFAULT} or PASSWORD = "string" or DELAY_KEY_WRITE = {0 | 1} or ROW_FORMAT= { default | dynamic | fixed | compressed } or RAID_TYPE= {1 | STRIPED | RAID0 } RAID_CHUNKS=# RAID_CHUNKSIZE=# or UNION = (table_name,[table_name...]) or INSERT_METHOD= {NO | FIRST | LAST } or DATA DIRECTORY="absolute path to directory" or INDEX DIRECTORY="absolute path to directory" A subset of the ALTER TABLE syntax that allows addition of foreign keys: ALTER [IGNORE] TABLE tbl_name alter_specification [, alter_specification] ... alter_specification: ADD [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name,...) [reference_definition] A subset of INSERT that we ignore: INSERT anything =head1 ARGUMENTS This parser takes a single optional parser_arg C, which provides the desired version for the target database. Any statement in the processed dump file, that is commented with a version higher than the one supplied, will be stripped. The default C is set to the conservative value of 40000 (MySQL 4.0) Valid version specifiers for C are listed L More information about the MySQL comment-syntax: L =cut use strict; use warnings; our $VERSION = '1.66'; our $DEBUG; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; use Storable qw(dclone); use DBI qw(:sql_types); use SQL::Translator::Utils qw/parse_mysql_version ddl_parser_instance/; use base qw(Exporter); our @EXPORT_OK = qw(parse); our %type_mapping = (); use constant DEFAULT_PARSER_VERSION => 40000; our $GRAMMAR = << 'END_OF_GRAMMAR'; { my ( $database_name, %tables, $table_order, @table_comments, %views, $view_order, %procedures, $proc_order ); my $delimiter = ';'; } # # The "eofile" rule makes the parser fail if any "statement" rule # fails. Otherwise, the first successful match by a "statement" # won't cause the failure needed to know that the parse, as a whole, # failed. -ky # startrule : statement(s) eofile { { database_name => $database_name, tables => \%tables, views => \%views, procedures => \%procedures, } } eofile : /^\Z/ statement : comment | use | set | drop | create | alter | insert | delimiter | empty_statement | use : /use/i NAME "$delimiter" { $database_name = $item[2]; @table_comments = (); } set : /set/i not_delimiter "$delimiter" { @table_comments = () } drop : /drop/i TABLE not_delimiter "$delimiter" drop : /drop/i NAME(s) "$delimiter" { @table_comments = () } bit: /(b'[01]{1,64}')/ | /(b"[01]{1,64}")/ string : # MySQL strings, unlike common SQL strings, can be double-quoted or # single-quoted. SQSTRING | DQSTRING nonstring : /[^;\'"]+/ statement_body : string | nonstring insert : /insert/i statement_body(s?) "$delimiter" delimiter : /delimiter/i /[\S]+/ { $delimiter = $item[2] } empty_statement : "$delimiter" alter : ALTER TABLE table_name alter_specification(s /,/) "$delimiter" { my $table_name = $item{'table_name'}; die "Cannot ALTER table '$table_name'; it does not exist" unless $tables{ $table_name }; for my $definition ( @{ $item[4] } ) { $definition->{'extra'}->{'alter'} = 1; push @{ $tables{ $table_name }{'constraints'} }, $definition; } } alter_specification : ADD foreign_key_def { $return = $item[2] } create : CREATE /database/i NAME "$delimiter" { @table_comments = () } create : CREATE TEMPORARY(?) TABLE opt_if_not_exists(?) table_name '(' create_definition(s /,/) /(,\s*)?\)/ table_option(s?) "$delimiter" { my $table_name = $item{'table_name'}; die "There is more than one definition for $table_name" if ($tables{$table_name}); $tables{ $table_name }{'order'} = ++$table_order; $tables{ $table_name }{'table_name'} = $table_name; if ( @table_comments ) { $tables{ $table_name }{'comments'} = [ @table_comments ]; @table_comments = (); } my $i = 1; for my $definition ( @{ $item[7] } ) { if ( $definition->{'supertype'} eq 'field' ) { my $field_name = $definition->{'name'}; $tables{ $table_name }{'fields'}{ $field_name } = { %$definition, order => $i }; $i++; if ( $definition->{'is_primary_key'} ) { push @{ $tables{ $table_name }{'constraints'} }, { type => 'primary_key', fields => [ $field_name ], } ; } } elsif ( $definition->{'supertype'} eq 'constraint' ) { push @{ $tables{ $table_name }{'constraints'} }, $definition; } elsif ( $definition->{'supertype'} eq 'index' ) { push @{ $tables{ $table_name }{'indices'} }, $definition; } } if ( my @options = @{ $item{'table_option(s?)'} } ) { for my $option ( @options ) { my ( $key, $value ) = each %$option; if ( $key eq 'comment' ) { push @{ $tables{ $table_name }{'comments'} }, $value; } else { push @{ $tables{ $table_name }{'table_options'} }, $option; } } } 1; } opt_if_not_exists : /if not exists/i create : CREATE UNIQUE(?) /(index|key)/i index_name /on/i table_name '(' field_name(s /,/) ')' "$delimiter" { @table_comments = (); push @{ $tables{ $item{'table_name'} }{'indices'} }, { name => $item[4], type => $item[2][0] ? 'unique' : 'normal', fields => $item[8], } ; } create : CREATE /trigger/i NAME not_delimiter "$delimiter" { @table_comments = (); } create : CREATE PROCEDURE NAME not_delimiter "$delimiter" { @table_comments = (); my $func_name = $item[3]; my $owner = ''; my $sql = "$item[1] $item[2] $item[3] $item[4]"; $procedures{ $func_name }{'order'} = ++$proc_order; $procedures{ $func_name }{'name'} = $func_name; $procedures{ $func_name }{'owner'} = $owner; $procedures{ $func_name }{'sql'} = $sql; } PROCEDURE : /procedure/i | /function/i create : CREATE or_replace(?) create_view_option(s?) /view/i NAME /as/i view_select_statement "$delimiter" { @table_comments = (); my $view_name = $item{'NAME'}; my $select_sql = $item{'view_select_statement'}; my $options = $item{'create_view_option(s?)'}; my $sql = join(q{ }, grep { defined and length } map { ref $_ eq 'ARRAY' ? @$_ : $_ } $item{'CREATE'}, $item{'or_replace(?)'}, $options, $view_name, 'as select', join(', ', map { sprintf('%s%s', $_->{'name'}, $_->{'alias'} ? ' as ' . $_->{'alias'} : '' ) } @{ $select_sql->{'columns'} || [] } ), ' from ', join(', ', map { sprintf('%s%s', $_->{'name'}, $_->{'alias'} ? ' as ' . $_->{'alias'} : '' ) } @{ $select_sql->{'from'}{'tables'} || [] } ), $select_sql->{'from'}{'where'} ? 'where ' . $select_sql->{'from'}{'where'} : '' , ); # Hack to strip database from function calls in SQL $sql =~ s#`\w+`\.(`\w+`\()##g; $views{ $view_name }{'order'} = ++$view_order; $views{ $view_name }{'name'} = $view_name; $views{ $view_name }{'sql'} = $sql; $views{ $view_name }{'options'} = $options; $views{ $view_name }{'select'} = $item{'view_select_statement'}; } create_view_option : view_algorithm | view_sql_security | view_definer or_replace : /or replace/i view_algorithm : /algorithm/i /=/ WORD { $return = "$item[1]=$item[3]"; } view_definer : /definer=\S+/i view_sql_security : /sql \s+ security \s+ (definer|invoker)/ixs not_delimiter : /.*?(?=$delimiter)/is view_select_statement : /[(]?/ /select/i view_column_def /from/i view_table_def /[)]?/ { $return = { columns => $item{'view_column_def'}, from => $item{'view_table_def'}, }; } view_column_def : /(.*?)(?=\bfrom\b)/ixs { # split on commas not in parens, # e.g., "concat_ws(\' \', first, last) as first_last" my @tmp = $1 =~ /((?:[^(,]+|\(.*?\))+)/g; my @cols; for my $col ( @tmp ) { my ( $name, $alias ) = map { s/^\s+|\s+$//g; s/[`]//g; $_ } split /\s+as\s+/i, $col; push @cols, { name => $name, alias => $alias || '' }; } $return = \@cols; } not_delimiter : /.*?(?=$delimiter)/is view_table_def : not_delimiter { my $clause = $item[1]; my $where = $1 if $clause =~ s/\bwhere \s+ (.*)//ixs; $clause =~ s/[)]\s*$//; my @tables; for my $tbl ( split( /\s*,\s*/, $clause ) ) { my ( $name, $alias ) = split /\s+as\s+/i, $tbl; push @tables, { name => $name, alias => $alias || '' }; } $return = { tables => \@tables, where => $where || '', }; } view_column_alias : /as/i NAME { $return = $item[2] } create_definition : constraint | index | field | comment | comment : /^\s*(?:#|-{2}).*\n/ { my $comment = $item[1]; $comment =~ s/^\s*(#|--)\s*//; $comment =~ s/\s*$//; $return = $comment; } comment : m{ / \* (?! \!) .*? \* / }xs { my $comment = $item[2]; $comment = substr($comment, 0, -2); $comment =~ s/^\s*|\s*$//g; $return = $comment; } comment_like_command : m{/\*!(\d+)?}s comment_end : m{ \* / }xs field_comment : /^\s*(?:#|-{2}).*\n/ { my $comment = $item[1]; $comment =~ s/^\s*(#|--)\s*//; $comment =~ s/\s*$//; $return = $comment; } blank : /\s*/ field : field_comment(s?) field_name data_type field_qualifier(s?) reference_definition(?) on_update(?) field_comment(s?) { my %qualifiers = map { %$_ } @{ $item{'field_qualifier(s?)'} || [] }; if ( my @type_quals = @{ $item{'data_type'}{'qualifiers'} || [] } ) { $qualifiers{ $_ } = 1 for @type_quals; } my $null = defined $qualifiers{'not_null'} ? $qualifiers{'not_null'} : 1; delete $qualifiers{'not_null'}; my @comments = ( @{ $item[1] }, (exists $qualifiers{comment} ? delete $qualifiers{comment} : ()) , @{ $item[7] } ); $return = { supertype => 'field', name => $item{'field_name'}, data_type => $item{'data_type'}{'type'}, size => $item{'data_type'}{'size'}, list => $item{'data_type'}{'list'}, null => $null, constraints => $item{'reference_definition(?)'}, comments => [ @comments ], %qualifiers, } } | field_qualifier : not_null { $return = { null => $item{'not_null'}, } } field_qualifier : default_val { $return = { default => $item{'default_val'}, } } field_qualifier : auto_inc { $return = { is_auto_inc => $item{'auto_inc'}, } } field_qualifier : primary_key { $return = { is_primary_key => $item{'primary_key'}, } } field_qualifier : unsigned { $return = { is_unsigned => $item{'unsigned'}, } } field_qualifier : /character set/i WORD { $return = { 'CHARACTER SET' => $item[2], } } field_qualifier : /collate/i WORD { $return = { COLLATE => $item[2], } } field_qualifier : /on update/i CURRENT_TIMESTAMP { $return = { 'ON UPDATE' => $item[2], } } field_qualifier : /unique/i KEY(?) { $return = { is_unique => 1, } } field_qualifier : KEY { $return = { has_index => 1, } } field_qualifier : /comment/i string { $return = { comment => $item[2], } } reference_definition : /references/i table_name parens_field_list(?) match_type(?) on_delete(?) on_update(?) { $return = { type => 'foreign_key', reference_table => $item[2], reference_fields => $item[3][0], match_type => $item[4][0], on_delete => $item[5][0], on_update => $item[6][0], } } match_type : /match full/i { 'full' } | /match partial/i { 'partial' } on_delete : /on delete/i reference_option { $item[2] } on_update : /on update/i CURRENT_TIMESTAMP { $item[2] } | /on update/i reference_option { $item[2] } reference_option: /restrict/i | /cascade/i | /set null/i | /no action/i | /set default/i { $item[1] } index : normal_index | fulltext_index | spatial_index | table_name : NAME field_name : NAME index_name : NAME data_type : WORD parens_value_list(s?) type_qualifier(s?) { my $type = $item[1]; my $size; # field size, applicable only to non-set fields my $list; # set list, applicable only to sets (duh) if ( uc($type) =~ /^(SET|ENUM)$/ ) { $size = undef; $list = $item[2][0]; } else { $size = $item[2][0]; $list = []; } $return = { type => $type, size => $size, list => $list, qualifiers => $item[3], } } parens_field_list : '(' field_name(s /,/) ')' { $item[2] } parens_value_list : '(' VALUE(s /,/) ')' { $item[2] } type_qualifier : /(BINARY|UNSIGNED|ZEROFILL)/i { lc $item[1] } field_type : WORD create_index : /create/i /index/i not_null : /not/i /null/i { $return = 0 } | /null/i { $return = 1 } unsigned : /unsigned/i { $return = 0 } default_val : /default/i CURRENT_TIMESTAMP { $return = $item[2]; } | /default/i VALUE { $return = $item[2]; } | /default/i bit { $item[2] =~ s/b['"]([01]+)['"]/$1/g; $return = $item[2]; } | /default/i /[\w\d:.-]+/ { $return = $item[2]; } | /default/i NAME # column value, allowed in MariaDB { $return = $item[2]; } auto_inc : /auto_increment/i { 1 } primary_key : /primary/i /key/i { 1 } constraint : primary_key_def | unique_key_def | foreign_key_def | check_def | expr : /[^)]* \( [^)]+ \) [^)]*/x # parens, balanced one deep | /[^)]+/ check_def : check_def_begin '(' expr ')' { $return = { supertype => 'constraint', type => 'check', name => $item[1], expression => $item[3], } } check_def_begin : /constraint/i /check/i NAME { $return = $item[3] } | /constraint/i NAME /check/i { $return = $item[2] } | /constraint/i /check/i { $return = '' } foreign_key_def : foreign_key_def_begin parens_field_list reference_definition { $return = { supertype => 'constraint', type => 'foreign_key', name => $item[1], fields => $item[2], %{ $item{'reference_definition'} }, } } foreign_key_def_begin : /constraint/i /foreign key/i NAME { $return = $item[3] } | /constraint/i NAME /foreign key/i { $return = $item[2] } | /constraint/i /foreign key/i { $return = '' } | /foreign key/i NAME { $return = $item[2] } | /foreign key/i { $return = '' } primary_key_def : primary_key index_type(?) '(' name_with_opt_paren(s /,/) ')' index_type(?) { $return = { supertype => 'constraint', type => 'primary_key', fields => $item[4], options => $item[2][0] || $item[6][0], }; } # In theory, and according to the doc, names should not be allowed here, but # MySQL accept (and ignores) them, so we are not going to be less :) | primary_key index_name_not_using(?) '(' name_with_opt_paren(s /,/) ')' index_type(?) { $return = { supertype => 'constraint', type => 'primary_key', fields => $item[4], options => $item[6][0], }; } unique_key_def : UNIQUE KEY(?) index_name_not_using(?) index_type(?) '(' name_with_opt_paren(s /,/) ')' index_type(?) { $return = { supertype => 'constraint', name => $item[3][0], type => 'unique', fields => $item[6], options => $item[4][0] || $item[8][0], } } normal_index : KEY index_name_not_using(?) index_type(?) '(' name_with_opt_paren(s /,/) ')' index_type(?) { $return = { supertype => 'index', type => 'normal', name => $item[2][0], fields => $item[5], options => $item[3][0] || $item[7][0], } } index_name_not_using : QUOTED_NAME | /(\b(?!using)\w+\b)/ { $return = ($1 =~ /^using/i) ? undef : $1 } index_type : /using (btree|hash|rtree)/i { $return = uc $1 } fulltext_index : /fulltext/i KEY(?) index_name(?) '(' name_with_opt_paren(s /,/) ')' { $return = { supertype => 'index', type => 'fulltext', name => $item{'index_name(?)'}[0], fields => $item[5], } } spatial_index : /spatial/i KEY(?) index_name(?) '(' name_with_opt_paren(s /,/) ')' { $return = { supertype => 'index', type => 'spatial', name => $item{'index_name(?)'}[0], fields => $item[5], } } name_with_opt_paren : NAME parens_value_list(s?) { $item[2][0] ? "$item[1]($item[2][0][0])" : $item[1] } UNIQUE : /unique/i KEY : /key/i | /index/i table_option : /comment/i /=/ string { $return = { comment => $item[3] }; } | /(default )?(charset|character set)/i /\s*=?\s*/ NAME { $return = { 'CHARACTER SET' => $item[3] }; } | /collate/i NAME { $return = { 'COLLATE' => $item[2] } } | /union/i /\s*=\s*/ '(' table_name(s /,/) ')' { $return = { $item[1] => $item[4] }; } | WORD /\s*=\s*/ table_option_value { $return = { $item[1] => $item[3] }; } table_option_value : VALUE | NAME default : /default/i ADD : /add/i ALTER : /alter/i CREATE : /create/i TEMPORARY : /temporary/i TABLE : /table/i WORD : /\w+/ DIGITS : /\d+/ COMMA : ',' BACKTICK : '`' DOUBLE_QUOTE: '"' SINGLE_QUOTE: "'" QUOTED_NAME : BQSTRING | SQSTRING | DQSTRING # MySQL strings, unlike common SQL strings, can have the delmiters # escaped either by doubling or by backslashing. BQSTRING: BACKTICK /(?:[^\\`]|``|\\.)*/ BACKTICK { ($return = $item[3]) =~ s/(\\[\\`]|``)/substr($1,1)/ge } DQSTRING: DOUBLE_QUOTE /(?:[^\\"]|""|\\.)*/ DOUBLE_QUOTE { ($return = $item[3]) =~ s/(\\[\\"]|"")/substr($1,1)/ge } SQSTRING: SINGLE_QUOTE /(?:[^\\']|''|\\.)*/ SINGLE_QUOTE { ($return = $item[3]) =~ s/(\\[\\']|'')/substr($1,1)/ge } NAME: QUOTED_NAME | /\w+/ VALUE : /[-+]?\d*\.?\d+(?:[eE]\d+)?/ { $item[1] } | SQSTRING | DQSTRING | /NULL/i { 'NULL' } # always a scalar-ref, so that it is treated as a function and not quoted by consumers CURRENT_TIMESTAMP : /current_timestamp(\(\))?/i { \'CURRENT_TIMESTAMP' } | /now\(\)/i { \'CURRENT_TIMESTAMP' } END_OF_GRAMMAR sub parse { my ($translator, $data) = @_; # Enable warnings within the Parse::RecDescent module. # Make sure the parser dies when it encounters an error local $::RD_ERRORS = 1 unless defined $::RD_ERRORS; # Enable warnings. This will warn on unused rules &c. local $::RD_WARN = 1 unless defined $::RD_WARN; # Give out hints to help fix problems. local $::RD_HINT = 1 unless defined $::RD_HINT; local $::RD_TRACE = $translator->trace ? 1 : undef; local $DEBUG = $translator->debug; my $parser = ddl_parser_instance('MySQL'); # Preprocess for MySQL-specific and not-before-version comments # from mysqldump my $parser_version = parse_mysql_version($translator->parser_args->{mysql_parser_version}, 'mysql') || DEFAULT_PARSER_VERSION; while ($data =~ s#/\*!(\d{5})?(.*?)\*/#($1 && $1 > $parser_version ? '' : $2)#es) { # do nothing; is there a better way to write this? -- ky } my $result = $parser->startrule($data); return $translator->error("Parse failed.") unless defined $result; warn "Parse result:" . Dumper($result) if $DEBUG; my $schema = $translator->schema; $schema->name($result->{'database_name'}) if $result->{'database_name'}; my @tables = sort { $result->{'tables'}{$a}{'order'} <=> $result->{'tables'}{$b}{'order'} } keys %{ $result->{'tables'} }; for my $table_name (@tables) { my $tdata = $result->{tables}{$table_name}; my $table = $schema->add_table(name => $tdata->{'table_name'},) or die $schema->error; $table->comments($tdata->{'comments'}); my @fields = sort { $tdata->{'fields'}->{$a}->{'order'} <=> $tdata->{'fields'}->{$b}->{'order'} } keys %{ $tdata->{'fields'} }; for my $fname (@fields) { my $fdata = $tdata->{'fields'}{$fname}; my $field = $table->add_field( name => $fdata->{'name'}, data_type => $fdata->{'data_type'}, size => $fdata->{'size'}, default_value => $fdata->{'default'}, is_auto_increment => $fdata->{'is_auto_inc'}, is_nullable => $fdata->{'null'}, comments => $fdata->{'comments'}, ) or die $table->error; $table->primary_key($field->name) if $fdata->{'is_primary_key'}; for my $qual (qw[ binary unsigned zerofill list collate ], 'character set', 'on update') { if (my $val = $fdata->{$qual} || $fdata->{ uc $qual }) { next if ref $val eq 'ARRAY' && !@$val; $field->extra($qual, $val); } } if ($fdata->{'has_index'}) { $table->add_index( name => '', type => 'NORMAL', fields => $fdata->{'name'}, ) or die $table->error; } if ($fdata->{'is_unique'}) { $table->add_constraint( name => '', type => 'UNIQUE', fields => $fdata->{'name'}, ) or die $table->error; } for my $cdata (@{ $fdata->{'constraints'} }) { next unless $cdata->{'type'} eq 'foreign_key'; $cdata->{'fields'} ||= [ $field->name ]; push @{ $tdata->{'constraints'} }, $cdata; } } for my $idata (@{ $tdata->{'indices'} || [] }) { my $index = $table->add_index( name => $idata->{'name'}, type => uc $idata->{'type'}, fields => $idata->{'fields'}, ) or die $table->error; } if (my @options = @{ $tdata->{'table_options'} || [] }) { my @cleaned_options; my @ignore_opts = $translator->parser_args->{'ignore_opts'} ? split(/,/, $translator->parser_args->{'ignore_opts'}) : (); if (@ignore_opts) { my $ignores = { map { $_ => 1 } @ignore_opts }; foreach my $option (@options) { # make sure the option isn't in ignore list my ($option_key) = keys %$option; if (!exists $ignores->{$option_key}) { push @cleaned_options, $option; } } } else { @cleaned_options = @options; } $table->options(\@cleaned_options) or die $table->error; } for my $cdata (@{ $tdata->{'constraints'} || [] }) { my $constraint = $table->add_constraint( name => $cdata->{'name'}, type => $cdata->{'type'}, fields => $cdata->{'fields'}, expression => $cdata->{'expression'}, reference_table => $cdata->{'reference_table'}, reference_fields => $cdata->{'reference_fields'}, match_type => $cdata->{'match_type'} || '', on_delete => $cdata->{'on_delete'} || $cdata->{'on_delete_do'}, on_update => $cdata->{'on_update'} || $cdata->{'on_update_do'}, ) or die $table->error; } # After the constrains and PK/idxs have been created, # we normalize fields normalize_field($_) for $table->get_fields; } my @procedures = sort { $result->{procedures}->{$a}->{'order'} <=> $result->{procedures}->{$b}->{'order'} } keys %{ $result->{procedures} }; for my $proc_name (@procedures) { $schema->add_procedure( name => $proc_name, owner => $result->{procedures}->{$proc_name}->{owner}, sql => $result->{procedures}->{$proc_name}->{sql}, ); } my @views = sort { $result->{views}->{$a}->{'order'} <=> $result->{views}->{$b}->{'order'} } keys %{ $result->{views} }; for my $view_name (@views) { my $view = $result->{'views'}{$view_name}; my @flds = map { $_->{'alias'} || $_->{'name'} } @{ $view->{'select'}{'columns'} || [] }; my @from = map { $_->{'alias'} || $_->{'name'} } @{ $view->{'from'}{'tables'} || [] }; $schema->add_view( name => $view_name, sql => $view->{'sql'}, order => $view->{'order'}, fields => \@flds, tables => \@from, options => $view->{'options'} ); } return 1; } # Takes a field, and returns sub normalize_field { my ($field) = @_; my ($size, $type, $list, $unsigned, $changed); $size = $field->size; $type = $field->data_type; $list = $field->extra->{list} || []; $unsigned = defined($field->extra->{unsigned}); if (!ref $size && $size eq 0) { if (lc $type eq 'tinyint') { $changed = $size != 4 - $unsigned; $size = 4 - $unsigned; } elsif (lc $type eq 'smallint') { $changed = $size != 6 - $unsigned; $size = 6 - $unsigned; } elsif (lc $type eq 'mediumint') { $changed = $size != 9 - $unsigned; $size = 9 - $unsigned; } elsif ($type =~ /^int(eger)?$/i) { $changed = $size != 11 - $unsigned || $type ne 'int'; $type = 'int'; $size = 11 - $unsigned; } elsif (lc $type eq 'bigint') { $changed = $size != 20; $size = 20; } elsif (lc $type =~ /(float|double|decimal|numeric|real|fixed|dec)/) { my $old_size = (ref $size || '') eq 'ARRAY' ? $size : []; $changed = @$old_size != 2 || $old_size->[0] != 8 || $old_size->[1] != 2; $size = [ 8, 2 ]; } } if ($type =~ /^tiny(text|blob)$/i) { $changed = $size != 255; $size = 255; } elsif ($type =~ /^(blob|text)$/i) { $changed = $size != 65_535; $size = 65_535; } elsif ($type =~ /^medium(blob|text)$/i) { $changed = $size != 16_777_215; $size = 16_777_215; } elsif ($type =~ /^long(blob|text)$/i) { $changed = $size != 4_294_967_295; $size = 4_294_967_295; } if ($field->data_type =~ /(set|enum)/i && !$field->size) { my %extra = $field->extra; my $longest = 0; for my $len (map {length} @{ $extra{'list'} || [] }) { $longest = $len if $len > $longest; } $changed = 1; $size = $longest if $longest; } if ($changed) { # We only want to clone the field, not *everything* { local $field->{table} = undef; $field->parsed_field(dclone($field)); $field->parsed_field->{table} = $field->table; } $field->size($size); $field->data_type($type); $field->sql_data_type($type_mapping{ lc $type }) if exists $type_mapping{ lc $type }; $field->extra->{list} = $list if @$list; } } 1; # ------------------------------------------------------------------- # Where man is not nature is barren. # William Blake # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE, Chris Mungall Ecjm@fruitfly.orgE. =head1 SEE ALSO Parse::RecDescent, SQL::Translator::Schema. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/PostgreSQL.pm0000644000000000000000000010231614716630117023376 0ustar00rootroot00000000000000package SQL::Translator::Parser::PostgreSQL; =head1 NAME SQL::Translator::Parser::PostgreSQL - parser for PostgreSQL =head1 SYNOPSIS use SQL::Translator; use SQL::Translator::Parser::PostgreSQL; my $translator = SQL::Translator->new; $translator->parser("SQL::Translator::Parser::PostgreSQL"); =head1 DESCRIPTION The grammar was started from the MySQL parsers. Here is the description from PostgreSQL, truncated to what's currently supported (patches welcome, of course) : Table: (http://www.postgresql.org/docs/current/sql-createtable.html) CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name ( { column_name data_type [ DEFAULT default_expr ] [ column_constraint [, ... ] ] | table_constraint } [, ... ] ) [ INHERITS ( parent_table [, ... ] ) ] [ WITH OIDS | WITHOUT OIDS ] where column_constraint is: [ CONSTRAINT constraint_name ] { NOT NULL | NULL | UNIQUE | PRIMARY KEY | CHECK (expression) | REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] } [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] and table_constraint is: [ CONSTRAINT constraint_name ] { UNIQUE ( column_name [, ... ] ) | PRIMARY KEY ( column_name [, ... ] ) | CHECK ( expression ) | EXCLUDE [USING acc_method] (expression) [INCLUDE (column [, ...])] [WHERE (predicate)] FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] } [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] Index : (http://www.postgresql.org/docs/current/sql-createindex.html) CREATE [ UNIQUE ] INDEX index_name ON table [ USING acc_method ] ( column [ ops_name ] [, ...] ) [ INCLUDE ( column [, ...] ) ] [ WHERE predicate ] CREATE [ UNIQUE ] INDEX index_name ON table [ USING acc_method ] ( func_name( column [, ... ]) [ ops_name ] ) [ WHERE predicate ] Alter table: ALTER TABLE [ ONLY ] table [ * ] ADD [ COLUMN ] column type [ column_constraint [ ... ] ] ALTER TABLE [ ONLY ] table [ * ] ALTER [ COLUMN ] column { SET DEFAULT value | DROP DEFAULT } ALTER TABLE [ ONLY ] table [ * ] ALTER [ COLUMN ] column SET STATISTICS integer ALTER TABLE [ ONLY ] table [ * ] RENAME [ COLUMN ] column TO newcolumn ALTER TABLE table RENAME TO new_table ALTER TABLE table ADD table_constraint_definition ALTER TABLE [ ONLY ] table DROP CONSTRAINT constraint { RESTRICT | CASCADE } ALTER TABLE table OWNER TO new_owner View : CREATE [ OR REPLACE ] VIEW view [ ( column name list ) ] AS SELECT query =cut use strict; use warnings; our $VERSION = '1.66'; our $DEBUG; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; use SQL::Translator::Utils qw/ddl_parser_instance/; use base qw(Exporter); our @EXPORT_OK = qw(parse); our $GRAMMAR = <<'END_OF_GRAMMAR'; { my ( %tables, @views, @triggers, $table_order, $field_order, @table_comments) } # # The "eofile" rule makes the parser fail if any "statement" rule # fails. Otherwise, the first successful match by a "statement" # won't cause the failure needed to know that the parse, as a whole, # failed. -ky # startrule : statement(s) eofile { { tables => \%tables, views => \@views, triggers => \@triggers, } } eofile : /^\Z/ statement : create | comment_on_table | comment_on_column | comment_on_other | comment | alter | grant | revoke | drop | insert | connect | update | set | select | copy | readin_symbol | commit | commit : /commit/i ';' connect : /^\s*\\connect.*\n/ set : /set/i /[^;]*/ ';' revoke : /revoke/i WORD(s /,/) /on/i TABLE(?) table_id /from/i NAME(s /,/) ';' { my $table_info = $item{'table_id'}; my $schema_name = $table_info->{'schema_name'}; my $table_name = $table_info->{'table_name'}; push @{ $tables{ $table_name }{'permissions'} }, { type => 'revoke', actions => $item[2], users => $item[7], } } revoke : /revoke/i WORD(s /,/) /on/i SCHEMA(?) schema_name /from/i NAME(s /,/) ';' { 1 } grant : /grant/i WORD(s /,/) /on/i TABLE(?) table_id /to/i NAME(s /,/) ';' { my $table_info = $item{'table_id'}; my $schema_name = $table_info->{'schema_name'}; my $table_name = $table_info->{'table_name'}; push @{ $tables{ $table_name }{'permissions'} }, { type => 'grant', actions => $item[2], users => $item[7], } } grant : /grant/i WORD(s /,/) /on/i SCHEMA(?) schema_name /to/i NAME(s /,/) ';' { 1 } drop : /drop/i /[^;]*/ ';' string : /'(\.|''|[^\\'])*'/ nonstring : /[^;\'"]+/ statement_body : string | nonstring insert : /insert/i statement_body(s?) ';' update : /update/i statement_body(s?) ';' # # Create table. # create : CREATE temporary(?) TABLE table_id '(' create_definition(s? /,/) ')' table_option(s?) ';' { my $table_info = $item{'table_id'}; my $schema_name = $table_info->{'schema_name'}; my $table_name = $table_info->{'table_name'}; $tables{ $table_name }{'order'} = ++$table_order; $tables{ $table_name }{'schema_name'} = $schema_name; $tables{ $table_name }{'table_name'} = $table_name; $tables{ $table_name }{'temporary'} = $item[2][0]; if ( @table_comments ) { $tables{ $table_name }{'comments'} = [ @table_comments ]; @table_comments = (); } my @constraints; for my $definition ( @{ $item[6] } ) { if ( $definition->{'supertype'} eq 'field' ) { my $field_name = $definition->{'name'}; $tables{ $table_name }{'fields'}{ $field_name } = { %$definition, order => $field_order++ }; for my $constraint ( @{ $definition->{'constraints'} || [] } ) { $constraint->{'fields'} = [ $field_name ]; push @{ $tables{ $table_name }{'constraints'} }, $constraint; } } elsif ( $definition->{'supertype'} eq 'constraint' ) { push @{ $tables{ $table_name }{'constraints'} }, $definition; } elsif ( $definition->{'supertype'} eq 'index' ) { push @{ $tables{ $table_name }{'indices'} }, $definition; } } for my $option ( @{ $item[8] } ) { $tables{ $table_name }{'table_options(s?)'}{ $option->{'type'} } = $option; } 1; } create : CREATE unique(?) /(index|key)/i index_name /on/i table_id using_method(?) '(' field_name(s /,/) ')' include_covering(?) where_predicate(?) ';' { my $table_info = $item{'table_id'}; my $schema_name = $table_info->{'schema_name'}; my $table_name = $table_info->{'table_name'}; push @{ $tables{ $table_name }{'indices'} }, { name => $item{'index_name'}, supertype => $item{'unique'}[0] ? 'constraint' : 'index', type => $item{'unique'}[0] ? 'unique' : 'normal', fields => $item[9], method => $item{'using_method(?)'}[0], where => $item{'where_predicate(?)'}[0], include => $item{'include_covering(?)'}[0] } ; } create : CREATE or_replace(?) temporary(?) VIEW view_id view_fields(?) /AS/i view_target ';' { push @views, { schema_name => $item{view_id}{schema_name}, view_name => $item{view_id}{view_name}, sql => $item{view_target}, fields => $item[6], is_temporary => $item[3][0], } } create: CREATE /MATERIALIZED VIEW/i if_not_exists(?) view_id view_fields(?) /AS/i view_target ';' { push @views, { schema_name => $item{view_id}{schema_name}, view_name => $item{view_id}{view_name}, sql => $item{view_target}, fields => $item[5], extra => { materialized => 1 } } } if_not_exists : /IF NOT EXISTS/i trigger_name : NAME trigger_scope : /FOR/i /EACH/i /(ROW|STATEMENT)/i { $return = lc $1 } before_or_after : /(before|after)/i { $return = lc $1 } trigger_action : /.+/ database_event : /insert|update|delete/i database_events : database_event(s /OR/) create : CREATE /TRIGGER/i trigger_name before_or_after database_events /ON/i table_id trigger_scope(?) trigger_action { # Hack to pass roundtrip tests which have trigger statements terminated by double semicolon # and expect the returned data to have the same my $action = $item{trigger_action}; $action =~ s/;$//; push @triggers, { name => $item{trigger_name}, perform_action_when => $item{before_or_after}, database_events => $item{database_events}, on_table => $item{table_id}{table_name}, scope => $item{'trigger_scope(?)'}[0], action => $action, } } # # Create anything else (e.g., domain, etc.) # create : CREATE WORD /[^;]+/ ';' { @table_comments = (); } using_method : /using/i WORD { $item[2] } where_predicate : /where/i /[^;]+/ where_paren_predicate : /where/i '(' /[^;]+/ ')' include_covering : /include/i '(' covering_field_name(s /,/) ')' { $item{'covering_field_name(s)'} } create_definition : field | table_constraint | comment : /^\s*(?:#|-{2})(.*)\n/ { my $comment = $item[1]; $comment =~ s/^\s*(#|-*)\s*//; $comment =~ s/\s*$//; $return = $comment; push @table_comments, $comment; } comment_on_table : /comment/i /on/i /table/i table_id /is/i comment_phrase ';' { my $table_info = $item{'table_id'}; my $schema_name = $table_info->{'schema_name'}; my $table_name = $table_info->{'table_name'}; push @{ $tables{ $table_name }{'comments'} }, $item{'comment_phrase'}; } comment_on_column : /comment/i /on/i /column/i column_name /is/i comment_phrase ';' { my $table_name = $item[4]->{'table'}; my $field_name = $item[4]->{'field'}; if ($tables{ $table_name }{'fields'}{ $field_name } ) { push @{ $tables{ $table_name }{'fields'}{ $field_name }{'comments'} }, $item{'comment_phrase'}; } else { die "No such column as $table_name.$field_name"; } } comment_on_other : /comment/i /on/i /\w+/ /\w+/ /is/i comment_phrase ';' { push(@table_comments, $item{'comment_phrase'}); } # [added by cjm 20041019] # [TODO: other comment-on types] # for now we just have a general mechanism for handling other # kinds of comments than table/column; I'm not sure of the best # way to incorporate these into the datamodel # # this is the exhaustive list of types of comment: #COMMENT ON DATABASE my_database IS 'Development Database'; #COMMENT ON INDEX my_index IS 'Enforces uniqueness on employee id'; #COMMENT ON RULE my_rule IS 'Logs UPDATES of employee records'; #COMMENT ON SEQUENCE my_sequence IS 'Used to generate primary keys'; #COMMENT ON TABLE my_table IS 'Employee Information'; #COMMENT ON TYPE my_type IS 'Complex Number support'; #COMMENT ON VIEW my_view IS 'View of departmental costs'; #COMMENT ON COLUMN my_table.my_field IS 'Employee ID number'; #COMMENT ON TRIGGER my_trigger ON my_table IS 'Used for R.I.'; # # this is tested by test 08 column_name : NAME '.' NAME { $return = { table => $item[1], field => $item[3] } } comment_phrase : /null/i { $return = 'NULL' } | SQSTRING | DOLLARSTRING field : field_comment(s?) field_name data_type field_meta(s?) field_comment(s?) { my ( $default, @constraints, $is_pk ); my $is_nullable = 1; for my $meta ( @{ $item[4] } ) { if ( $meta->{'type'} eq 'default' ) { $default = $meta; next; } elsif ( $meta->{'type'} eq 'not_null' ) { $is_nullable = 0; } elsif ( $meta->{'type'} eq 'primary_key' ) { $is_pk = 1; } push @constraints, $meta if $meta->{'supertype'} eq 'constraint'; } my @comments = ( @{ $item[1] }, @{ $item[5] } ); $return = { supertype => 'field', name => $item{'field_name'}, data_type => $item{'data_type'}{'type'}, size => $item{'data_type'}{'size'}, is_nullable => $is_nullable, default => $default->{'value'}, constraints => [ @constraints ], comments => [ @comments ], is_primary_key => $is_pk || 0, is_auto_increment => $item{'data_type'}{'is_auto_increment'}, } } | field_comment : /^\s*(?:#|-{2})(.*)\n/ { my $comment = $item[1]; $comment =~ s/^\s*(#|-*)\s*//; $comment =~ s/\s*$//; $return = $comment; } field_meta : default_val | column_constraint view_fields : '(' field_name(s /,/) ')' { $return = join (',', @{$item[2]} ) } column_constraint : constraint_name(?) column_constraint_type deferrable(?) deferred(?) { my $desc = $item{'column_constraint_type'}; my $type = $desc->{'type'}; my $fields = $desc->{'fields'} || []; my $expression = $desc->{'expression'} || ''; $return = { supertype => 'constraint', name => $item{'constraint_name'}[0] || '', type => $type, expression => $type eq 'check' ? $expression : '', deferrable => $item{'deferrable'}, deferred => $item{'deferred'}, reference_table => $desc->{'reference_table'}, reference_fields => $desc->{'reference_fields'}, match_type => $desc->{'match_type'}, on_delete => $desc->{'on_delete'} || $desc->{'on_delete_do'}, on_update => $desc->{'on_update'} || $desc->{'on_update_do'}, } } constraint_name : /constraint/i NAME { $item[2] } column_constraint_type : /not null/i { $return = { type => 'not_null' } } | /null/i { $return = { type => 'null' } } | /unique/i { $return = { type => 'unique' } } | /primary key/i { $return = { type => 'primary_key' } } | /check/i '(' /[^)]+/ ')' { $return = { type => 'check', expression => $item[3] } } | /references/i table_id parens_word_list(?) match_type(?) key_action(s?) { my $table_info = $item{'table_id'}; my $schema_name = $table_info->{'schema_name'}; my $table_name = $table_info->{'table_name'}; my ( $on_delete, $on_update ); for my $action ( @{ $item[5] || [] } ) { $on_delete = $action->{'action'} if $action->{'type'} eq 'delete'; $on_update = $action->{'action'} if $action->{'type'} eq 'update'; } $return = { type => 'foreign_key', reference_table => $table_name, reference_fields => $item[3][0], match_type => $item[4][0], on_delete => $on_delete, on_update => $on_update, } } table_id : schema_qualification(?) NAME { $return = { schema_name => $item[1][0], table_name => $item[2] } } view_id : schema_qualification(?) NAME { $return = { schema_name => $item[1][0], view_name => $item[2] } } view_target : /select|with/i /[^;]+/ { $return = "$item[1] $item[2]"; } # SELECT views _may_ support outer parens, and we used to produce # such sql, although non-standard. Use ugly lookeahead to parse view_target : '(' /select/i / [^;]+ (?= \) ) /x ')' { $return = "$item[2] $item[3]" } view_target_spec : schema_qualification : NAME '.' schema_name : NAME field_name : NAME covering_field_name : NAME double_quote: /"/ index_name : NAME array_indicator : '[' ']' { $return = $item[1].$item[2] } data_type : pg_data_type parens_value_list(?) array_indicator(?) { my $data_type = $item[1]; $data_type->{type} .= $item[3][0] if $item[3][0]; # # We can deduce some sizes from the data type's name. # if ( my @size = @{$item[2]} ) { $data_type->{'size'} = (@size == 1 ? $size[0] : \@size); } $return = $data_type; } pg_data_type : /(bigint|int8)/i { $return = { type => 'integer', size => 20, }; } | /(smallint|int2)/i { $return = { type => 'integer', size => 5, }; } | /interval/i { $return = { type => 'interval' }; } | /(integer|int4?)/i # interval must come before this { $return = { type => 'integer', size => 10, }; } | /(real|float4)/i { $return = { type => 'real', size => 10, }; } | /(double precision|float8?)/i { $return = { type => 'float', size => 20, }; } | /(bigserial|serial8)/i { $return = { type => 'integer', size => 20, is_auto_increment => 1, }; } | /serial4?/i { $return = { type => 'integer', size => 11, is_auto_increment => 1, }; } | /(bit varying|varbit)/i { $return = { type => 'varbit' }; } | /character varying/i { $return = { type => 'varchar' }; } | /char(acter)?/i { $return = { type => 'char' }; } | /bool(ean)?/i { $return = { type => 'boolean' }; } | /bytea/i { $return = { type => 'bytea' }; } | / ( timestamp (?:tz)? ) (?: \( \d \) )? ( \s with (?:out)? \s time \s zone )? /ix { $return = { type => 'timestamp' . ($2||'') }; } | / ( time (?:tz)? ) (?: \( \d \) )? ( \s with (?:out)? \s time \s zone )? /ix { $return = { type => 'time' . ($2||'') }; } | /text/i { $return = { type => 'text', size => 64_000, }; } | /(bit|box|cidr|circle|date|inet|line|lseg|macaddr|money|numeric|decimal|path|point|polygon|varchar|json|hstore|uuid)/i { $return = { type => $item[1] }; } parens_value_list : '(' VALUE(s /,/) ')' { $item[2] } parens_word_list : '(' NAME(s /,/) ')' { $item[2] } field_size : '(' num_range ')' { $item{'num_range'} } num_range : DIGITS ',' DIGITS { $return = $item[1].','.$item[3] } | DIGITS { $return = $item[1] } table_constraint : comment(s?) constraint_name(?) table_constraint_type deferrable(?) deferred(?) comment(s?) { my $desc = $item{'table_constraint_type'}; my $type = $desc->{'type'}; my $fields = $desc->{'fields'}; my $expression = $desc->{'expression'}; my @comments = ( @{ $item[1] }, @{ $item[-1] } ); my $expr_constraint = $type eq 'check' || $type eq 'exclude'; $return = { name => $item[2][0] || '', supertype => 'constraint', type => $type, fields => $expr_constraint ? [] : $fields, expression => $expr_constraint ? $expression : '', deferrable => $item{'deferrable'}, deferred => $item{'deferred'}, on_delete => $desc->{'on_delete'} || $desc->{'on_delete_do'}, on_update => $desc->{'on_update'} || $desc->{'on_update_do'}, comments => [ @comments ], %{$desc}{qw/include using where reference_table reference_fields match_type/} } } table_constraint_type : /primary key/i '(' NAME(s /,/) ')' include_covering(?) { $return = { type => 'primary_key', fields => $item[3], include => $item{'include_convering(?)'}[0], } } | /unique/i '(' NAME(s /,/) ')' include_covering(?) { $return = { type => 'unique', fields => $item[3], include => $item{'include_convering(?)'}[0], } } | /check/i '(' /[^)]+/ ')' { $return = { type => 'check', expression => $item[3], } } | /exclude/i using_method(?) '(' /[^)]+/ ')' include_covering(?) where_paren_predicate(?) { $return = { type => 'exclude', expression => $item{__PATTERN2__}, using => $item{'using_method(?)'}[0], include => $item{'include_convering(?)'}[0], where => $item{'where_paren_predicate(?)'}[0], } } | /foreign key/i '(' NAME(s /,/) ')' /references/i table_id parens_word_list(?) match_type(?) key_action(s?) { my ( $on_delete, $on_update ); for my $action ( @{ $item[9] || [] } ) { $on_delete = $action->{'action'} if $action->{'type'} eq 'delete'; $on_update = $action->{'action'} if $action->{'type'} eq 'update'; } $return = { supertype => 'constraint', type => 'foreign_key', fields => $item[3], reference_table => $item[6]->{'table_name'}, reference_fields => $item[7][0], match_type => $item[8][0], on_delete => $on_delete || '', on_update => $on_update || '', } } deferrable : not(?) /deferrable/i { $return = ( $item[1] =~ /not/i ) ? 0 : 1; } deferred : /initially/i /(deferred|immediate)/i { $item[2] } match_type : /match/i /partial|full|simple/i { $item[2] } key_action : key_delete | key_update key_delete : /on delete/i key_mutation { $return = { type => 'delete', action => $item[2], }; } key_update : /on update/i key_mutation { $return = { type => 'update', action => $item[2], }; } key_mutation : /no action/i { $return = 'no_action' } | /restrict/i { $return = 'restrict' } | /cascade/i { $return = 'cascade' } | /set null/i { $return = 'set null' } | /set default/i { $return = 'set default' } alter : alter_table table_id add_column field ';' { my $field_def = $item[4]; $tables{ $item[2]->{'table_name'} }{'fields'}{ $field_def->{'name'} } = { %$field_def, order => $field_order++ }; 1; } alter : alter_table table_id ADD table_constraint ';' { my $table_name = $item[2]->{'table_name'}; my $constraint = $item[4]; push @{ $tables{ $table_name }{'constraints'} }, $constraint; 1; } alter : alter_table table_id drop_column NAME restrict_or_cascade(?) ';' { $tables{ $item[2]->{'table_name'} }{'fields'}{ $item[4] }{'drop'} = 1; 1; } alter : alter_table table_id alter_column NAME alter_default_val ';' { $tables{ $item[2]->{'table_name'} }{'fields'}{ $item[4] }{'default'} = $item[5]->{'value'}; 1; } # # These will just parse for now but won't affect the structure. - ky # alter : alter_table table_id /rename/i /to/i NAME ';' { 1 } alter : alter_table table_id alter_column NAME SET /statistics/i INTEGER ';' { 1 } alter : alter_table table_id alter_column NAME SET /storage/i storage_type ';' { 1 } alter : alter_table table_id rename_column NAME /to/i NAME ';' { 1 } alter : alter_table table_id DROP /constraint/i NAME restrict_or_cascade ';' { 1 } alter : alter_table table_id /owner/i /to/i NAME ';' { 1 } alter : alter_sequence NAME /owned/i /by/i column_name ';' { 1 } storage_type : /(plain|external|extended|main)/i temporary : /temp(orary)?\b/i { 1; } or_replace : /or replace/i alter_default_val : SET default_val { $return = { value => $item[2]->{'value'} } } | DROP DEFAULT { $return = { value => undef } } # # This is a little tricky to get right, at least WRT to making the # tests pass. The problem is that the constraints are stored just as # a list (no name access), and the tests expect the constraints in a # particular order. I'm going to leave the rule but disable the code # for now. - ky # alter : alter_table table_id alter_column NAME alter_nullable ';' { # my $table_name = $item[2]->{'table_name'}; # my $field_name = $item[4]; # my $is_nullable = $item[5]->{'is_nullable'}; # # $tables{ $table_name }{'fields'}{ $field_name }{'is_nullable'} = # $is_nullable; # # if ( $is_nullable ) { # 1; # push @{ $tables{ $table_name }{'constraints'} }, { # type => 'not_null', # fields => [ $field_name ], # }; # } # else { # for my $i ( # 0 .. $#{ $tables{ $table_name }{'constraints'} || [] } # ) { # my $c = $tables{ $table_name }{'constraints'}[ $i ] or next; # my $fields = join( '', @{ $c->{'fields'} || [] } ) or next; # if ( $c->{'type'} eq 'not_null' && $fields eq $field_name ) { # delete $tables{ $table_name }{'constraints'}[ $i ]; # last; # } # } # } 1; } alter_nullable : SET not_null { $return = { is_nullable => 0 } } | DROP not_null { $return = { is_nullable => 1 } } not_null : /not/i /null/i not : /not/i add_column : ADD COLUMN(?) alter_table : ALTER TABLE ONLY(?) alter_sequence : ALTER SEQUENCE drop_column : DROP COLUMN(?) alter_column : ALTER COLUMN(?) rename_column : /rename/i COLUMN(?) restrict_or_cascade : /restrict/i | /cascade/i # Handle functions that can be called select : SELECT select_function ';' { 1 } # Read the setval function but don't do anything with it because this parser # isn't handling sequences select_function : schema_qualification(?) /setval/i '(' VALUE /,/ VALUE /,/ /(true|false)/i ')' { 1 } # Skipping all COPY commands copy : COPY WORD /[^;]+/ ';' { 1 } { 1 } # The "\." allows reading in from STDIN but this isn't needed for schema # creation, so it is skipped. readin_symbol : '\.' {1} # # End basically useless stuff. - ky # create_table : CREATE TABLE create_index : CREATE /index/i default_val : DEFAULT DEFAULT_VALUE ( '::' data_type )(?) { my $val = $item[2]; $val =~ s/^\((\d+)\)\z/$1/; # for example (0)::smallint $return = { supertype => 'constraint', type => 'default', value => $val, } } | /null/i { $return = { supertype => 'constraint', type => 'default', value => 'NULL', } } DEFAULT_VALUE : VALUE | /\w+\(.*\)/ | /\w+/ | /\(\d+\)/ name_with_opt_paren : NAME parens_value_list(s?) { $item[2][0] ? "$item[1]($item[2][0][0])" : $item[1] } unique : /unique/i { 1 } key : /key/i | /index/i table_option : /inherits/i '(' NAME(s /,/) ')' { $return = { type => 'inherits', table_name => $item[3] } } | /with(out)? oids/i { $return = { type => $item[1] =~ /out/i ? 'without_oids' : 'with_oids' } } ADD : /add/i ALTER : /alter/i CREATE : /create/i ONLY : /only/i DEFAULT : /default/i DROP : /drop/i COLUMN : /column/i TABLE : /table/i VIEW : /view/i SCHEMA : /schema/i SEMICOLON : /\s*;\n?/ SEQUENCE : /sequence/i SELECT : /select/i COPY : /copy/i INTEGER : /\d+/ WORD : /\w+/ DIGITS : /\d+/ COMMA : ',' SET : /set/i NAME : DQSTRING | /\w+/ DQSTRING : '"' /((?:[^"]|"")+)/ '"' { ($return = $item[3]) =~ s/""/"/g; } SQSTRING : "'" /((?:[^']|'')*)/ "'" { ($return = $item[3]) =~ s/''/'/g } DOLLARSTRING : /\$[^\$]*\$/ /.*?(?=\Q$item[1]\E)/s "$item[1]" { $return = $item[3]; } VALUE : /[-+]?\d*\.?\d+(?:[eE]\d+)?/ | SQSTRING | DOLLARSTRING | /null/i { 'NULL' } END_OF_GRAMMAR sub parse { my ($translator, $data) = @_; # Enable warnings within the Parse::RecDescent module. local $::RD_ERRORS = 1 unless defined $::RD_ERRORS; # Make sure the parser dies when it encounters an error local $::RD_WARN = 1 unless defined $::RD_WARN; # Enable warnings. This will warn on unused rules &c. local $::RD_HINT = 1 unless defined $::RD_HINT; # Give out hints to help fix problems. local $::RD_TRACE = $translator->trace ? 1 : undef; local $DEBUG = $translator->debug; my $parser = ddl_parser_instance('PostgreSQL'); my $result = $parser->startrule($data); die "Parse failed.\n" unless defined $result; warn Dumper($result) if $DEBUG; my $schema = $translator->schema; my @tables = sort { ($result->{tables}{$a}{'order'} || 0) <=> ($result->{tables}{$b}{'order'} || 0) } keys %{ $result->{tables} }; for my $table_name (@tables) { my $tdata = $result->{tables}{$table_name}; my $table = $schema->add_table( #schema => $tdata->{'schema_name'}, name => $tdata->{'table_name'}, ) or die "Couldn't create table '$table_name': " . $schema->error; $table->extra(temporary => 1) if $tdata->{'temporary'}; $table->comments($tdata->{'comments'}); my @fields = sort { $tdata->{'fields'}{$a}{'order'} <=> $tdata->{'fields'}{$b}{'order'} } keys %{ $tdata->{'fields'} }; for my $fname (@fields) { my $fdata = $tdata->{'fields'}{$fname}; next if $fdata->{'drop'}; my $field = $table->add_field( name => $fdata->{'name'}, data_type => $fdata->{'data_type'}, size => $fdata->{'size'}, default_value => $fdata->{'default'}, is_auto_increment => $fdata->{'is_auto_increment'}, is_nullable => $fdata->{'is_nullable'}, comments => $fdata->{'comments'}, ) or die $table->error; $table->primary_key($field->name) if $fdata->{'is_primary_key'}; for my $cdata (@{ $fdata->{'constraints'} }) { next unless $cdata->{'type'} eq 'foreign_key'; $cdata->{'fields'} ||= [ $field->name ]; push @{ $tdata->{'constraints'} }, $cdata; } } for my $idata (@{ $tdata->{'indices'} || [] }) { my @options = (); push @options, { using => $idata->{'method'} } if $idata->{method}; push @options, { where => $idata->{'where'} } if $idata->{where}; push @options, { include => $idata->{'include'} } if $idata->{include}; my $index = $table->add_index( name => $idata->{'name'}, type => uc $idata->{'type'}, fields => $idata->{'fields'}, options => \@options ) or die $table->error . ' ' . $table->name; } for my $cdata (@{ $tdata->{'constraints'} || [] }) { my $options = [ # load this up with the extras map +{ %$cdata{$_} }, grep $cdata->{$_}, qw/include using where/ ]; my $constraint = $table->add_constraint( name => $cdata->{'name'}, type => $cdata->{'type'}, fields => $cdata->{'fields'}, reference_table => $cdata->{'reference_table'}, reference_fields => $cdata->{'reference_fields'}, match_type => $cdata->{'match_type'} || '', on_delete => $cdata->{'on_delete'} || $cdata->{'on_delete_do'}, on_update => $cdata->{'on_update'} || $cdata->{'on_update_do'}, expression => $cdata->{'expression'}, options => $options ) or die "Can't add constraint of type '" . $cdata->{'type'} . "' to table '" . $table->name . "': " . $table->error; } } for my $vinfo (@{ $result->{views} }) { my $sql = $vinfo->{sql}; $sql =~ s/\A\s+|\s+\z//g; my $view = $schema->add_view( name => $vinfo->{view_name}, sql => $sql, fields => $vinfo->{fields}, ); $view->extra(temporary => 1) if $vinfo->{is_temporary}; } for my $trigger (@{ $result->{triggers} }) { $schema->add_trigger(%$trigger); } return 1; } 1; # ------------------------------------------------------------------- # Rescue the drowning and tie your shoestrings. # Henry David Thoreau # ------------------------------------------------------------------- =pod =head1 AUTHORS Ken Y. Clark Ekclark@cpan.orgE, Allen Day Eallenday@ucla.eduE. =head1 SEE ALSO perl(1), Parse::RecDescent. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/DBI.pm0000644000000000000000000000767514716630117022005 0ustar00rootroot00000000000000package SQL::Translator::Parser::DBI; =head1 NAME SQL::Translator::Parser::DBI - "parser" for DBI handles =head1 SYNOPSIS use DBI; use SQL::Translator; my $dbh = DBI->connect('dsn', 'user', 'pass', { RaiseError => 1, FetchHashKeyName => 'NAME_lc', } ); my $translator = SQL::Translator->new( parser => 'DBI', parser_args => { dbh => $dbh, }, ); Or: use SQL::Translator; my $translator = SQL::Translator->new( parser => 'DBI', parser_args => { dsn => 'dbi:mysql:FOO', db_user => 'guest', db_password => 'password', } ); =head1 DESCRIPTION This parser accepts an open database handle (or the arguments to create one) and queries the database directly for the information. The following are acceptable arguments: =over 4 =item * dbh An open DBI database handle. NB: Be sure to create the database with the "FetchHashKeyName => 'NAME_lc'" option as all the DBI parsers expect lowercased column names. =item * dsn The DSN to use for connecting to a database. =item * db_user The user name to use for connecting to a database. =item * db_password The password to use for connecting to a database. =back There is no need to specify which type of database you are querying as this is determined automatically by inspecting $dbh->{'Driver'}{'Name'}. If a parser exists for your database, it will be used automatically; if not, the code will fail automatically (and you can write the parser and contribute it to the project!). Currently parsers exist for the following databases: =over 4 =item * MySQL =item * SQLite =item * Sybase =item * PostgreSQL (still experimental) =back Most of these parsers are able to query the database directly for the structure rather than parsing a text file. For large schemas, this is probably orders of magnitude faster than traditional parsing (which uses Parse::RecDescent, an amazing module but really quite slow). Though no Oracle parser currently exists, it would be fairly easy to query an Oracle database directly by using DDL::Oracle to generate a DDL for the schema and then using the normal Oracle parser on this. Perhaps future versions of SQL::Translator will include the ability to query Oracle directly and skip the parsing of a text file, too. =cut use strict; use warnings; use DBI; our @EXPORT; our $VERSION = '1.66'; use constant DRIVERS => { mysql => 'MySQL', odbc => 'SQLServer', oracle => 'Oracle', pg => 'PostgreSQL', sqlite => 'SQLite', sybase => 'Sybase', db2 => 'DB2', }; use Exporter; use SQL::Translator::Utils qw(debug); use base qw(Exporter); @EXPORT = qw(parse); # # Passed a SQL::Translator instance and a string containing the data # sub parse { my ($tr, $data) = @_; my $args = $tr->parser_args; my $dbh = $args->{'dbh'}; my $dsn = $args->{'dsn'}; my $db_user = $args->{'db_user'}; my $db_password = $args->{'db_password'}; my $dbh_is_local; unless ($dbh) { die 'No DSN' unless $dsn; $dbh = DBI->connect( $dsn, $db_user, $db_password, { FetchHashKeyName => 'NAME_lc', LongReadLen => 3000, LongTruncOk => 1, RaiseError => 1, } ); $dbh_is_local = 1; } die 'No database handle' unless defined $dbh; my $db_type = $dbh->{'Driver'}{'Name'} or die 'Cannot determine DBI type'; my $driver = DRIVERS->{ lc $db_type } or die "$db_type not supported"; my $pkg = "SQL::Translator::Parser::DBI::$driver"; my $sub = $pkg . '::parse'; SQL::Translator::load($pkg); my $s = eval { no strict 'refs'; &{$sub}($tr, $dbh) or die "No result from $pkg"; }; my $err = $@; eval { $dbh->disconnect } if (defined $dbh and $dbh_is_local); die $err if $err; return $s; } 1; =pod =head1 AUTHOR Ken Y. Clark Ekclark@cpan.orgE. =head1 SEE ALSO DBI, SQL::Translator. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/Sybase.pm0000644000000000000000000002372514716630117022627 0ustar00rootroot00000000000000package SQL::Translator::Parser::Sybase; =head1 NAME SQL::Translator::Parser::Sybase - parser for Sybase =head1 SYNOPSIS use SQL::Translator::Parser::Sybase; =head1 DESCRIPTION Mostly parses the output of "dbschema.pl," a Perl script freely available from http://www.midsomer.org. The parsing is not complete, however, and you would probably have much better luck using the DBI-Sybase parser included with SQL::Translator. =cut use strict; use warnings; our $VERSION = '1.66'; our $DEBUG; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; use SQL::Translator::Utils qw/ddl_parser_instance/; use base qw(Exporter); our @EXPORT_OK = qw(parse); our $GRAMMAR = <<'END_OF_GRAMMAR'; { my ( %tables, @table_comments, $table_order ); } startrule : statement(s) eofile { \%tables } eofile : /^\Z/ statement : create_table | create_procedure | create_index | create_constraint | comment | use | setuser | if | print | grant | exec | use : /use/i WORD GO { @table_comments = () } setuser : /setuser/i NAME GO if : /if/i object_not_null begin if_command end GO if_command : grant | create_index | create_constraint object_not_null : /object_id/i '(' ident ')' /is not null/i print : /\s*/ /print/i /.*/ else : /else/i /.*/ begin : /begin/i end : /end/i grant : /grant/i /[^\n]*/ exec : exec_statement(s) GO exec_statement : /exec/i /[^\n]+/ comment : comment_start comment_middle comment_end { my $comment = $item[2]; $comment =~ s/^\s*|\s*$//mg; $comment =~ s/^\**\s*//mg; push @table_comments, $comment; } comment_start : /^\s*\/\*/ comment_end : /\s*\*\// comment_middle : m{([^*]+|\*(?!/))*} # # Create table. # create_table : /create/i /table/i ident '(' create_def(s /,/) ')' lock(?) on_system(?) GO { my $table_owner = $item[3]{'owner'}; my $table_name = $item[3]{'name'}; if ( @table_comments ) { $tables{ $table_name }{'comments'} = [ @table_comments ]; @table_comments = (); } $tables{ $table_name }{'order'} = ++$table_order; $tables{ $table_name }{'name'} = $table_name; $tables{ $table_name }{'owner'} = $table_owner; $tables{ $table_name }{'system'} = $item[7]; my $i = 0; for my $def ( @{ $item[5] } ) { if ( $def->{'supertype'} eq 'field' ) { my $field_name = $def->{'name'}; $tables{ $table_name }{'fields'}{ $field_name } = { %$def, order => $i }; $i++; if ( $def->{'is_primary_key'} ) { push @{ $tables{ $table_name }{'constraints'} }, { type => 'primary_key', fields => [ $field_name ], }; } } elsif ( $def->{'supertype'} eq 'constraint' ) { push @{ $tables{ $table_name }{'constraints'} }, $def; } else { push @{ $tables{ $table_name }{'indices'} }, $def; } } } create_constraint : /create/i constraint { @table_comments = (); push @{ $tables{ $item[2]{'table'} }{'constraints'} }, $item[2]; } create_index : /create/i index { @table_comments = (); push @{ $tables{ $item[2]{'table'} }{'indices'} }, $item[2]; } create_procedure : /create/i /procedure/i procedure_body GO { @table_comments = (); } procedure_body : not_go(s) not_go : /((?!go).)*/ create_def : field | index | constraint blank : /\s*/ field : field_name data_type nullable(?) { $return = { supertype => 'field', name => $item{'field_name'}, data_type => $item{'data_type'}{'type'}, size => $item{'data_type'}{'size'}, nullable => $item[3][0], # default => $item{'default_val'}[0], # is_auto_inc => $item{'auto_inc'}[0], # is_primary_key => $item{'primary_key'}[0], } } constraint : primary_key_constraint | unique_constraint field_name : WORD index_name : WORD table_name : WORD data_type : WORD field_size(?) { $return = { type => $item[1], size => $item[2][0] } } lock : /lock/i /datarows/i field_type : WORD field_size : '(' num_range ')' { $item{'num_range'} } num_range : DIGITS ',' DIGITS { $return = $item[1].','.$item[3] } | DIGITS { $return = $item[1] } nullable : /not/i /null/i { $return = 0 } | /null/i { $return = 1 } default_val : /default/i /(?:')?[\w\d.-]*(?:')?/ { $item[2]=~s/'//g; $return=$item[2] } auto_inc : /auto_increment/i { 1 } primary_key_constraint : /primary/i /key/i index_name(?) parens_field_list { $return = { supertype => 'constraint', name => $item{'index_name'}[0], type => 'primary_key', fields => $item[4], } } unique_constraint : /unique/i clustered(?) INDEX(?) index_name(?) on_table(?) parens_field_list { $return = { supertype => 'constraint', type => 'unique', clustered => $item[2][0], name => $item[4][0], table => $item[5][0], fields => $item[6], } } clustered : /clustered/i { $return = 1 } | /nonclustered/i { $return = 0 } INDEX : /index/i on_table : /on/i table_name { $return = $item[2] } on_system : /on/i /system/i { $return = 1 } index : clustered(?) INDEX index_name(?) on_table(?) parens_field_list { $return = { supertype => 'index', type => 'normal', clustered => $item[1][0], name => $item[3][0], table => $item[4][0], fields => $item[5], } } parens_field_list : '(' field_name(s /,/) ')' { $item[2] } ident : QUOTE(?) WORD '.' WORD QUOTE(?) { $return = { owner => $item[2], name => $item[4] } } | WORD { $return = { name => $item[2] } } GO : /^go/i NAME : QUOTE(?) /\w+/ QUOTE(?) { $item[2] } WORD : /[\w#]+/ DIGITS : /\d+/ COMMA : ',' QUOTE : /'/ END_OF_GRAMMAR sub parse { my ($translator, $data) = @_; # Enable warnings within the Parse::RecDescent module. local $::RD_ERRORS = 1 unless defined $::RD_ERRORS; # Make sure the parser dies when it encounters an error local $::RD_WARN = 1 unless defined $::RD_WARN; # Enable warnings. This will warn on unused rules &c. local $::RD_HINT = 1 unless defined $::RD_HINT; # Give out hints to help fix problems. local $::RD_TRACE = $translator->trace ? 1 : undef; local $DEBUG = $translator->debug; my $parser = ddl_parser_instance('Sybase'); my $result = $parser->startrule($data); return $translator->error("Parse failed.") unless defined $result; warn Dumper($result) if $DEBUG; my $schema = $translator->schema; my @tables = sort { $result->{$a}->{'order'} <=> $result->{$b}->{'order'} } keys %{$result}; for my $table_name (@tables) { my $tdata = $result->{$table_name}; my $table = $schema->add_table(name => $tdata->{'name'}) or die "Can't create table '$table_name': ", $schema->error; $table->comments($tdata->{'comments'}); my @fields = sort { $tdata->{'fields'}->{$a}->{'order'} <=> $tdata->{'fields'}->{$b}->{'order'} } keys %{ $tdata->{'fields'} }; for my $fname (@fields) { my $fdata = $tdata->{'fields'}{$fname}; my $field = $table->add_field( name => $fdata->{'name'}, data_type => $fdata->{'data_type'}, size => $fdata->{'size'}, default_value => $fdata->{'default'}, is_auto_increment => $fdata->{'is_auto_inc'}, is_nullable => $fdata->{'nullable'}, comments => $fdata->{'comments'}, ) or die $table->error; $table->primary_key($field->name) if $fdata->{'is_primary_key'}; for my $qual (qw[ binary unsigned zerofill list ]) { if (my $val = $fdata->{$qual} || $fdata->{ uc $qual }) { next if ref $val eq 'ARRAY' && !@$val; $field->extra($qual, $val); } } if ($field->data_type =~ /(set|enum)/i && !$field->size) { my %extra = $field->extra; my $longest = 0; for my $len (map {length} @{ $extra{'list'} || [] }) { $longest = $len if $len > $longest; } $field->size($longest) if $longest; } for my $cdata (@{ $fdata->{'constraints'} }) { next unless $cdata->{'type'} eq 'foreign_key'; $cdata->{'fields'} ||= [ $field->name ]; push @{ $tdata->{'constraints'} }, $cdata; } } for my $idata (@{ $tdata->{'indices'} || [] }) { my $index = $table->add_index( name => $idata->{'name'}, type => uc $idata->{'type'}, fields => $idata->{'fields'}, ) or die $table->error; } for my $cdata (@{ $tdata->{'constraints'} || [] }) { my $constraint = $table->add_constraint( name => $cdata->{'name'}, type => $cdata->{'type'}, fields => $cdata->{'fields'}, reference_table => $cdata->{'reference_table'}, reference_fields => $cdata->{'reference_fields'}, match_type => $cdata->{'match_type'} || '', on_delete => $cdata->{'on_delete'} || $cdata->{'on_delete_do'}, on_update => $cdata->{'on_update'} || $cdata->{'on_update_do'}, ) or die $table->error; } } return 1; } 1; # ------------------------------------------------------------------- # Every hero becomes a bore at last. # Ralph Waldo Emerson # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Y. Clark Ekclark@cpan.orgE. =head1 SEE ALSO SQL::Translator, SQL::Translator::Parser::DBI, L. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/XML.pm0000644000000000000000000000100514716630117022024 0ustar00rootroot00000000000000package SQL::Translator::Parser::XML; =pod =head1 NAME SQL::Translator::Parser::XML - Alias to XML::SQLFairy parser =head1 DESCRIPTION This module is an alias to the XML::SQLFairy parser. =head1 SEE ALSO SQL::Translator::Parser::XML::SQLFairy. =head1 AUTHOR Ken Y. Clark Ekclark@cpan.orgE. =cut use strict; use warnings; our $DEBUG; our $VERSION = '1.66'; $DEBUG = 1 unless defined $DEBUG; use SQL::Translator::Parser::XML::SQLFairy; *parse = \&SQL::Translator::Parser::XML::SQLFairy::parse; 1; SQL-Translator-1.66/lib/SQL/Translator/Parser/DB2.pm0000644000000000000000000005443614701227332021746 0ustar00rootroot00000000000000package SQL::Translator::Parser::DB2; =head1 NAME SQL::Translator::Parser::DB2 - parser for DB2 =head1 SYNOPSIS use SQL::Translator; use SQL::Translator::Parser::DB2; my $translator = SQL::Translator->new; $translator->parser("SQL::Translator::Parser::DB2"); =head1 DESCRIPTION This is a grammar for parsing CREATE statements for DB2 =cut use warnings; use strict; use base qw(Exporter); our @EXPORT_OK = qw(parse); our $DEBUG; use Data::Dumper; use SQL::Translator::Utils qw/ddl_parser_instance/; # !!!!!! # THIS GRAMMAR IS INCOMPLETE!!! # Khisanth is slowly working on a replacement # !!!!!! our $GRAMMAR = <<'END_OF_GRAMMAR'; { my ( %tables, $table_order, @table_comments, @views, @triggers ); } # # The "eofile" rule makes the parser fail if any "statement" rule # fails. Otherwise, the first successful match by a "statement" # won't cause the failure needed to know that the parse, as a whole, # failed. -ky # startrule : statement(s) eofile { $return = { tables => \%tables, views => \@views, triggers => \@triggers, } } eofile : /^\Z/ statement : comment | create | comment : /^\s*-{2}.*\n/ { my $comment = $item[1]; $comment =~ s/^\s*(-{2})\s*//; $comment =~ s/\s*$//; $return = $comment; } create: CREATE TRIGGER trigger_name before type /ON/i table_name reference_b(?) /FOR EACH ROW/i 'MODE DB2SQL' triggered_action { my $table_name = $item{'table_name'}{'name'}; $return = { table => $table_name, schema => $item{'trigger_name'}{'schema'}, name => $item{'trigger_name'}{'name'}, when => 'before', db_event => $item{'type'}->{'event'}, fields => $item{'type'}{'fields'}, condition => $item{'triggered_action'}{'condition'}, reference => $item{'reference_b'}, granularity => $item[9], action => $item{'triggered_action'}{'statement'} }; push @triggers, $return; } create: CREATE TRIGGER trigger_name after type /ON/i table_name reference_a(?) /FOR EACH ROW|FOR EACH STATEMENT/i 'MODE DB2SQL' triggered_action { my $table_name = $item{'table_name'}{'name'}; $return = { table => $table_name, schema => $item{'trigger_name'}{'schema'}, name => $item{'trigger_name'}{'name'}, when => 'after', db_event => $item{'type'}{'event'}, fields => $item{'type'}{'fields'}, condition => $item{'triggered_action'}{'condition'}, reference => $item{'reference_a'}, granularity => $item[9], action => $item{'triggered_action'}{'statement'} }; push @triggers, $return; } create: CREATE /FEDERATED|/i VIEW view_name column_list(?) /AS/i with_expression(?) SQL_procedure_statement { $return = { name => $item{view_name}{name}, sql => $item{SQL_procedure_statement}, with => $item{'with_expression(?)'}, fields => $item{'column_list(?)'} }; push @views, $return; } # create: CREATE /FEDERATED/i VIEW view_name col_list_or_of(?) /AS/i with_expression(?) fullselect options(?) # col_list_or_of: column_list | /OF/i ( root_view_definition | subview_definition ) with_expression: /WITH/i common_table_expression(s /,/) { $return = $item{'common_table_expression'}; } SQL_procedure_statement: /[^;]*/ /(;|\z)/ { $return = $item[1] . $item[2] } column_list: '(' column_name(s /,/) ')' { $return = join(' ', '(', @{$item[2]}, ')'); } CREATE: /create/i TRIGGER: /trigger/i VIEW: /view/i INNER: /inner/i LEFT: /left/i RIGHT: /right/i FULL: /full/i OUTER: /outer/i WHERE: /where/i trigger_name: SCHEMA '.' NAME { $return = { schema => $item[1], name => $item[3] } } | NAME { $return = { name => $item[1] } } table_name: SCHEMA '.' NAME { $return = { schema => $item[1], name => $item[3] } } | NAME { $return = { name => $item[1] } } view_name: SCHEMA '.' NAME { $return = { schema => $item[1], name => $item[3] } } | NAME { $return = { name => $item[1] } } column_name: NAME identifier: NAME correlation_name: NAME numeric_constant: /\d+/ SCHEMA: /\w+/ SCHEMA: /\w{1,128}/ NAME: /\w+/ NAME: /\w{1,18}/ options: /WITH/i ( /CASCADED/i | /LOCAL/i ) /CHECK\s+OPTION/i # root_view_definition: /MODE\s+DB2SQL/i '(' oid_column ( /,/ with_options )(?) ')' # subview_definition: /MODE\s+DB2SQL/i under_clause ( '(' with_options ')' )(?) /EXTEND/i(?) # oid_column: /REF\s+IS/i oid_column_name /USER\s+GENERATED\s+UNCHECKED/i(?) # with_options: ( column_name /WITH\s+OPTIONS/i ( /SCOPE/i ( typed_table_name | typed_view_name ) | /READ\s+ONLY/i )(s /,/) )(s /,/) # under_clause: /UNDER/i superview_name /INHERIT\s+SELECT\s+PRIVILEGES/i common_table_expression: table_name column_list /AS/i get_bracketed { $return = { name => $item{table_name}{name}, query => $item[4] }; } get_bracketed: { extract_bracketed($text, '('); } common_table_expression: table_name column_list /AS/i '(' fullselect ')' # fullselect: ( subselect | '(' fullselect ')' | values_clause ) ( ( /UNION/i | /UNION/i /ALL/i | /EXCEPT/i | /EXCEPT/i /ALL/i | /INTERSECT/i | /INTERSECT/i /ALL/i ) ( subselect | '(' fullselect ')' | values_clause ) )(s) # values_clause: /VALUES/i values_row(s /,/) # values_row: ( expression | /NULL/i ) | '(' ( expression | /NULL/i )(s /,/) ')' # subselect: select_clause from_clause where_clause(?) group_by_clause(?) having_clause(?) # select_clause: SELECT ( /ALL/i | /DISTINCT )(?) ( '*' | ( expression ( /AS|/i new_column_name )(?) | exposed_name '.*' )(s /,/) ) # from_clause: /FROM/i table_name(s /,/) # from_clause: /FROM/i table_reference(s /,/) # table_reference: # ( # ( nickname # | table_name # | view_name # ) # | ( /ONLY/i # | /OUTER/i # ) '(' # ( table_name # | view_name # ) ')' # ) correlation_clause(?) # | TABLE '(' function_name '(' expression(s? /,/) ')' ')' correlation_clause # | TABLE(?) '(' fullselect ')' correlation_clause # | joined_table # correlation_clause: /AS/i(?) correlation_name column_list(?) # joined_table: # table_reference ( INNER # | outer # )(?) JOIN table_reference ON join_condition # | '(' joined_table ')' # outer: ( LEFT | RIGHT | FULL ) OUTER(?) where_clause: WHERE search_condition # group_by_clause: /GROUP\s+BY/i ( grouping_expression # | grouping_sets # | super_groups # )(s /,/) # grouping_expression: expression # orderby_clause: /ORDER\s+BY/i ( sort_key ( /ASC/i | /DESC/i)(?) )(s /,/) # sort_key: simple_column_name | simple_integer | sort_key_expression # # Name of one of the selected columns! # simple_column_name: NAME # simple_integer: /\d+/ # { $item[1] <= $numberofcolumns && $item[1] > 1 } # sort_key_expression: expression # { expression from select columns list, grouping_expression, column function.. } # grouping_sets: /GROUPING\s+SETS/i '(' ( # ( grouping_expression # | super_groups # ) # | '(' ( grouping_expression # | super_groups # )(s /,/) ')' # )(s /,/) ')' # super_groups: /ROLLUP/i '(' grouping_expression_list ')' # | /CUBE/i '(' grouping_expression_list ')' # | grand_total # grouping_expression_list: ( grouping_expression # | '(' grouping_expression(s /,/) ')' # )(s /,/) # grand_total: '(' ')' # having_clause: /HAVING/i search_condition when_clause: /WHEN/i '(' search_condition ')' {$return = $item[3]} triggered_action: when_clause(?) SQL_procedure_statement { $return = { 'condition' => $item[1][0], 'statement' => $item{'SQL_procedure_statement'} }; } before: /NO CASCADE BEFORE/i after: /AFTER/i type: /UPDATE/i /OF/i column_name(s /,/) { $return = { event => 'update_on', fields => $item[3] } } type: ( /INSERT/i | /DELETE/i | /UPDATE/i ) { $return = { event => $item[1] } } reference_b: /REFERENCING/i old_new_corr(0..2) { $return = join(' ', $item[1], join(' ', @{$item[2]}) ) } reference_a: /REFERENCING/i old_new_corr(0..2) old_new_table(0..2) { $return = join(' ', $item[1], join(' ', @{$item[2]}), join(' ', @{$item[3]}) ) } old_new_corr: /OLD/i /(AS)?/i correlation_name { $return = join(' ', @item[1..3] ) } | /NEW/i /(AS)?/i correlation_name { $return = join(' ', @item[1..3] ) } old_new_table: /OLD_TABLE/i /(AS)?/i identifier { $return = join(' ', @item[1..3] ) } | /NEW_TABLE/i /(AS)?/i identifier { $return = join(' ', @item[1..3] ) } # Just parsing simple search conditions for now. search_condition: /[^)]+/ expression: ( ( '+' | '-' )(?) ( function | '(' expression ')' | constant | column_name | host_variable | special_register | '(' scalar_fullselect ')' | labeled_duration | case_expression | cast_specification # | dereference_operation | OLAP_function | method_invocation | subtype_treatment | sequence_reference ) )(s /operator/) operator: ( /CONCAT/i | '||' ) | '/' | '*' | '+' | '-' function: ( /SYSIBM\.|/i sysibm_function | /SYSFUN\.|/i sysfun_function | userdefined_function ) '(' func_args(s /,/) ')' constant: int_const | float_const | dec_const | char_const | hex_const | grastr_const func_args: expression sysibm_function: ( /ABS/i | /ABSVAL/i ) | /AVG/i | /BIGINT/i | /BLOB/i | /CHAR/i | /CLOB/i | /COALESCE/i | ( /CONCAT/ | '||' ) | ( /CORRELATION/i | /CORR/ ) | /COUNT/i | /COUNT_BIG/i | (/COVARIANCE/i | /COVAR/i ) | /DATE/i | /DAY/i | /DAYS/i | /DBCLOB/i | ( /DECIMAL/i | /DEC/i ) | /DECRYPT_BIN/i | /DECRYPT_CHAR/i | /DEREF/i | /DIGITS/i | /DLCOMMENT/i | /DLLINKTYPE/i | /DLURLCOMPLETE/i | /DLURLPATH/i | /DLURLPATHONLY/i | /DLURLSCHEME/i | /DLURLSERVER/i | /DLVALUE/i | ( /DOUBLE/i | /DOUBLE_PRECISION/i ) | /ENCRYPT/i | /EVENT_MON_STATE/i | /FLOAT/i | /GETHINT/i | /GENERATE_UNIQUE/i | /GRAPHIC/i | /GROUPING/i | /HEX/i | /HOUR/i | /IDENTITY_VAL_LOCAL/i | ( /INTEGER/i | /INT/ ) | ( /LCASE/i | /LOWER/ ) | /LENGTH/i | /LONG_VARCHAR/i | /LONG_VARGRAPHIC/i | /LTRIM/i | /MAX/i | /MICROSECOND/i | /MIN/i | /MINUTE/i | /MONTH/i | /MULTIPLY_ACT/i | /NODENUMBER/i | /NULLIF/i | /PARTITON/i | /POSSTR/i | /RAISE_ERROR/i | /REAL/i | /REC2XML/i | /REGR_AVGX/i | /REGR_AVGY/i | /REGR_COUNT/i | ( /REGR_INTERCEPT/i | /REGR_ICPT/i ) | /REGR_R2/i | /REGR_SLOPE/i | /REGR_SXX/i | /REGR_SXY/i | /REGR_SYY/i | /RTRIM/i | /SECOND/i | /SMALLINT/i | /STDDEV/i | /SUBSTR/i | /SUM/i | /TABLE_NAME/i | /TABLE_SCHEMA/i | /TIME/i | /TIMESTAMP/i | /TRANSLATE/i | /TYPE_ID/i | /TYPE_NAME/i | /TYPE_SCHEMA/i | ( /UCASE/i | /UPPER/i ) | /VALUE/i | /VARCHAR/i | /VARGRAPHIC/i | ( /VARIANCE/i | /VAR/i ) | /YEAR/i sysfun: ( /ABS/i | /ABSVAL/i ) | /ACOS/i | /ASCII/i | /ASIN/i | /ATAN/i | /ATAN2/i | ( /CEIL/i | /CEILING/i ) | /CHAR/i | /CHR/i | /COS/i | /COT/i | /DAYNAME/i | /DAYOFWEEK/i | /DAYOFWEEK_ISO/i | /DAYOFYEAR/i | /DEGREES/i | /DIFFERENCE/i | /DOUBLE/i | /EXP/i | /FLOOR/i | /GET_ROUTINE_SAR/i | /INSERT/i | /JULIAN_DAY/i | /LCASE/i | /LEFT/i | /LN/i | /LOCATE/i | /LOG/i | /LOG10/i | /LTRIM/i | /MIDNIGHT_SECONDS/i | /MOD/i | /MONTHNAME/i | /POWER/i | /PUT_ROUTINE_SAR/i | /QUARTER/i | /RADIANS/i | /RAND/i | /REPEAT/i | /REPLACE/i | /RIGHT/i | /ROUND/i | /RTRIM/I | /SIGN/i | /SIN/i | /SOUNDEX/i | /SPACE/i | /SQLCACHE_SNAPSHOT/i | /SQRT/i | /TAN/i | /TIMESTAMP_ISO/i | /TIMESTAMPDIFF/i | ( /TRUNCATE/i | /TRUNC/i ) | /UCASE/i | /WEEK/i | /WEEK_ISO/i scalar_fullselect: '(' fullselect ')' labeled_duration: ld_type ld_duration ld_type: function | '(' expression ')' | constant | column_name | host_variable ld_duration: /YEARS?/i | /MONTHS?/i | /DAYS?/i | /HOURS?/i | /MINUTES?/i | /SECONDS?/i | /MICROSECONDS?/i case_expression: /CASE/i ( searched_when_clause | simple_when_clause ) ( /ELSE\s+NULL/i | /ELSE/i result_expression )(?) /END/i searched_when_clause: ( /WHEN/i search_condition /THEN/i ( result_expression | /NULL/i ) )(s) simple_when_clause: expression ( /WHEN/i search_condition /THEN/i ( result_expression | /NULL/i ) )(s) result_expression: expression cast_specification: /CAST/i '(' ( expression | /NULL/i | parameter_marker ) /AS/i data_type ( /SCOPE/ ( typed_table_name | typed_view_name ) )(?) ')' dereference_operation: scoped_reference_expression '->' name1 ( '(' expression(s) ')' )(?) # ( '(' expression(s /,/) ')' )(?) scoped_reference_expression: expression { # scoped, reference } name1: NAME OLAP_function: ranking_function | numbering_function | aggregation_function ranking_function: ( /RANK/ '()' | /DENSE_RANK|DENSERANK/i '()' ) /OVER/i '(' window_partition_clause(?) window_order_clause ')' numbering_function: /ROW_NUMBER|ROWNUMBER/i '()' /OVER/i '(' window_partition_clause(?) ( window_order_clause window_aggregation_group_clause(?) )(?) ( /RANGE\s+BETWEEN\s+UNBOUNDED\s+PRECEDING\s+AND\s+UNBBOUNDED\s+FOLLOWING/i | window_aggregation_group_clause )(?) ')' window_partition_clause: /PARTITION\s+BY/i partitioning_expression(s /,/) window_order_clause: /ORDER\s+BY/i ( sort_key_expression ( asc_option | desc_option )(?) )(s /,/) asc_option: /ASC/i ( /NULLS\s+FIRST/i | /NULLS\s+LAST/i )(?) desc_option: /DESC/i ( /NULLS\s+FIRST/i | /NULLS\s+LAST/i )(?) window_aggregation_group_clause: ( /ROWS/i | /RANGE/i ) ( group_start | group_between | group_end ) group_start: /UNBOUNDED\s+PRECEDING/i | unsigned_constant /PRECEDING/i | /CURRENT\s+ROW/i group_between: /BETWEEN/i group_bound1 /AND/i group_bound2 group_bound1: /UNBOUNDED\s+PRECEDING/i | unsigned_constant /PRECEDING/i | unsigned_constant /FOLLOWING/i | /CURRENT\s+ROW/i group_bound2: /UNBOUNDED\s+PRECEDING/i | unsigned_constant /PRECEDING/i | unsigned_constant /FOLLOWING/i | /CURRENT\s+ROW/i group_end: /UNBOUNDED\s+PRECEDING/i | unsigned_constant /FOLLOWING/i method_invocation: subject_expression '..' method_name ( '(' expression(s) ')' # ( '(' expression(s /,/) ')' )(?) subject_expression: expression { # with static result type that is a used-defined struct type } method_name: NAME { # must be a method of subject_expression } subtype_treatment: /TREAT/i '(' expression /AS/i data_type ')' sequence_reference: nextval_expression | prevval_expression nextval_expression: /NEXTVAL\s+FOR/i sequence_name prevval_expression: /PREVVAL\s+FOR/i sequence_name sequence_name: NAME search_condition: /NOT|/i ( predicate ( /SELECTIVITY/i numeric_constant )(?) | '(' search_condition ')' ) cond(s?) cond: ( /AND/i | /OR/i ) /NOT|/i ( predicate ( /SELECTIVITY/i numeric_constant )(?) | '(' search_condition ')' ) predicate: basic_p | quantified_p | between_p | exists_p | in_p | like_p | null_p | type_p basic_p: expression /(=|<>|<|>|<=|=>|\^=|\^<|\^>|\!=)/ expression quantified_p: expression1 /(=|<>|<|>|<=|=>|\^=|\^<|\^>|\!=)/ /SOME|ANY|ALL/i '(' fullselect ')' END_OF_GRAMMAR sub parse { my ($translator, $data) = @_; # Enable warnings within the Parse::RecDescent module. local $::RD_ERRORS = 1 unless defined $::RD_ERRORS; # Make sure the parser dies when it encounters an error local $::RD_WARN = 1 unless defined $::RD_WARN; # Enable warnings. This will warn on unused rules &c. local $::RD_HINT = 1 unless defined $::RD_HINT; # Give out hints to help fix problems. local $::RD_TRACE = $translator->trace ? 1 : undef; local $DEBUG = $translator->debug; my $parser = ddl_parser_instance('DB2'); my $result = $parser->startrule($data); return $translator->error("Parse failed.") unless defined $result; warn Dumper($result) if $DEBUG; my $schema = $translator->schema; my @tables = map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [ $result->{'tables'}{$_}->{'order'}, $_ ] } keys %{ $result->{'tables'} }; for my $table_name (@tables) { my $tdata = $result->{'tables'}{$table_name}; my $table = $schema->add_table(name => $tdata->{'name'},) or die $schema->error; $table->comments($tdata->{'comments'}); for my $fdata (@{ $tdata->{'fields'} }) { my $field = $table->add_field( name => $fdata->{'name'}, data_type => $fdata->{'data_type'}, size => $fdata->{'size'}, default_value => $fdata->{'default'}, is_auto_increment => $fdata->{'is_auto_inc'}, is_nullable => $fdata->{'is_nullable'}, comments => $fdata->{'comments'}, ) or die $table->error; $table->primary_key($field->name) if $fdata->{'is_primary_key'}; for my $cdata (@{ $fdata->{'constraints'} }) { next unless $cdata->{'type'} eq 'foreign_key'; $cdata->{'fields'} ||= [ $field->name ]; push @{ $tdata->{'constraints'} }, $cdata; } } for my $idata (@{ $tdata->{'indices'} || [] }) { my $index = $table->add_index( name => $idata->{'name'}, type => uc $idata->{'type'}, fields => $idata->{'fields'}, ) or die $table->error; } for my $cdata (@{ $tdata->{'constraints'} || [] }) { my $constraint = $table->add_constraint( name => $cdata->{'name'}, type => $cdata->{'type'}, fields => $cdata->{'fields'}, reference_table => $cdata->{'reference_table'}, reference_fields => $cdata->{'reference_fields'}, match_type => $cdata->{'match_type'} || '', on_delete => $cdata->{'on_delete'} || $cdata->{'on_delete_do'}, on_update => $cdata->{'on_update'} || $cdata->{'on_update_do'}, ) or die $table->error; } } for my $def (@{ $result->{'views'} || [] }) { my $view = $schema->add_view( name => $def->{'name'}, sql => $def->{'sql'}, ); } for my $def (@{ $result->{'triggers'} || [] }) { my $trig = $schema->add_trigger( name => $def->{'name'}, perform_action_when => $def->{'when'}, database_event => $def->{'db_event'}, action => $def->{'action'}, fields => $def->{'fields'}, on_table => $def->{'table'} ); $trig->extra( reference => $def->{'reference'}, condition => $def->{'condition'}, granularity => $def->{'granularity'} ); } return 1; } 1; =pod =head1 AUTHOR Jess Robinson =head1 SEE ALSO perl(1), Parse::RecDescent, SQL::Translator::Schema. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/XML/0000755000000000000000000000000014716630506021474 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Parser/XML/SQLFairy.pm0000644000000000000000000002172614716630117023472 0ustar00rootroot00000000000000package SQL::Translator::Parser::XML::SQLFairy; =head1 NAME SQL::Translator::Parser::XML::SQLFairy - parser for SQL::Translator's XML. =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new( show_warnings => 1 ); my $out = $obj->translate( from => 'XML-SQLFairy', to => 'MySQL', filename => 'schema.xml', ) or die $translator->error; print $out; =head1 DESCRIPTION This parser handles the flavor of XML used natively by the SQLFairy project (L). The XML must be in the XML namespace C. See L for details of this format. You do not need to specify every attribute of the Schema objects as any missing from the XML will be set to their default values. e.g. A field could be written using only; Instead of the full; If you do not explicitly set the order of items using order attributes on the tags then the order the tags appear in the XML will be used. =head2 default_value Leave the attribute out all together to use the default in L. Use empty quotes or 'EMPTY_STRING' for a zero length string. 'NULL' for an explicit null (currently sets default_value to undef in the field object). =head2 ARGS Doesn't take any extra parser args at the moment. =head1 LEGACY FORMAT The previous version of the SQLFairy XML allowed the attributes of the schema objects to be written as either xml attributes or as data elements, in any combination. While this allows for lots of flexibility in writing the XML the result is a great many possible XML formats, not so good for DTD writing, XPathing etc! So we have moved to a fixed version described in L. This version of the parser will still parse the old formats and emit warnings when it sees them being used but they should be considered B. To convert your old format files simply pass them through the translator :) $ sqlt -f XML-SQLFairy -t XML-SQLFairy schema-old.xml > schema-new.xml =cut use strict; use warnings; our ($DEBUG, @EXPORT_OK); our $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; use Carp::Clan qw/^SQL::Translator/; use Exporter; use base qw(Exporter); @EXPORT_OK = qw(parse); use base qw/SQL::Translator::Parser/; # Doesnt do anything at the mo! use SQL::Translator::Utils 'debug'; use XML::LibXML; use XML::LibXML::XPathContext; sub parse { my ($translator, $data) = @_; my $schema = $translator->schema; local $DEBUG = $translator->debug; my $doc = XML::LibXML->new->parse_string($data); my $xp = XML::LibXML::XPathContext->new($doc); $xp->registerNs("sqlf", "http://sqlfairy.sourceforge.net/sqlfairy.xml"); # # Work our way through the tables # my @nodes = $xp->findnodes('/sqlf:schema/sqlf:table|/sqlf:schema/sqlf:tables/sqlf:table'); for my $tblnode ( sort { ("" . $xp->findvalue('sqlf:order|@order', $a) || 0) <=> ("" . $xp->findvalue('sqlf:order|@order', $b) || 0) } @nodes ) { debug "Adding table:" . $xp->findvalue('sqlf:name', $tblnode); my $table = $schema->add_table(get_tagfields($xp, $tblnode, "sqlf:" => qw/name order extra/)) or die $schema->error; # # Fields # my @nodes = $xp->findnodes('sqlf:fields/sqlf:field', $tblnode); foreach (sort { ("" . $xp->findvalue('sqlf:order', $a) || 0) <=> ("" . $xp->findvalue('sqlf:order', $b) || 0) } @nodes) { my %fdata = get_tagfields( $xp, $_, "sqlf:", qw/name data_type size default_value is_nullable extra is_auto_increment is_primary_key is_foreign_key comments/ ); if (exists $fdata{'default_value'} and defined $fdata{'default_value'}) { if ($fdata{'default_value'} =~ /^\s*NULL\s*$/) { $fdata{'default_value'} = undef; } elsif ($fdata{'default_value'} =~ /^\s*EMPTY_STRING\s*$/) { $fdata{'default_value'} = ""; } } my $field = $table->add_field(%fdata) or die $table->error; $table->primary_key($field->name) if $fdata{'is_primary_key'}; # # TODO: # - We should be able to make the table obj spot this when # we use add_field. # } # # Constraints # @nodes = $xp->findnodes('sqlf:constraints/sqlf:constraint', $tblnode); foreach (@nodes) { my %data = get_tagfields( $xp, $_, "sqlf:", qw/name type table fields reference_fields reference_table match_type on_delete on_update extra/ ); $table->add_constraint(%data) or die $table->error; } # # Indexes # @nodes = $xp->findnodes('sqlf:indices/sqlf:index', $tblnode); foreach (@nodes) { my %data = get_tagfields($xp, $_, "sqlf:", qw/name type fields options extra/); $table->add_index(%data) or die $table->error; } # # Comments # @nodes = $xp->findnodes('sqlf:comments/sqlf:comment', $tblnode); foreach (@nodes) { my $data = $_->string_value; $table->comments($data); } } # tables loop # # Views # @nodes = $xp->findnodes('/sqlf:schema/sqlf:view|/sqlf:schema/sqlf:views/sqlf:view'); foreach (@nodes) { my %data = get_tagfields($xp, $_, "sqlf:", qw/name sql fields order extra/); $schema->add_view(%data) or die $schema->error; } # # Triggers # @nodes = $xp->findnodes('/sqlf:schema/sqlf:trigger|/sqlf:schema/sqlf:triggers/sqlf:trigger'); foreach (@nodes) { my %data = get_tagfields( $xp, $_, "sqlf:", qw/ name perform_action_when database_event database_events fields on_table action order extra scope / ); # back compat if (my $evt = $data{database_event} and $translator->{show_warnings}) { carp 'The database_event tag is deprecated - please use ' . 'database_events (which can take one or more comma separated ' . 'event names)'; $data{database_events} = join(', ', $data{database_events} || (), $evt,); } # split into arrayref if (my $evts = $data{database_events}) { $data{database_events} = [ split(/\s*,\s*/, $evts) ]; } $schema->add_trigger(%data) or die $schema->error; } # # Procedures # @nodes = $xp->findnodes('/sqlf:schema/sqlf:procedure|/sqlf:schema/sqlf:procedures/sqlf:procedure'); foreach (@nodes) { my %data = get_tagfields($xp, $_, "sqlf:", qw/name sql parameters owner comments order extra/); $schema->add_procedure(%data) or die $schema->error; } return 1; } sub get_tagfields { # # get_tagfields XP, NODE, NAMESPACE => qw/TAGNAMES/; # get_tagfields $node, "sqlf:" => qw/name type fields reference/; # # Returns hash of data. # TODO - Add handling of an explicit NULL value. # my ($xp, $node, @names) = @_; my (%data, $ns); foreach (@names) { if (m/:$/) { $ns = $_; next; } # Set def namespace my $thisns = (s/(^.*?:)// ? $1 : $ns); my $is_attrib = m/^(sql|comments|action|extra)$/ ? 0 : 1; my $attrib_path = "\@$_"; my $tag_path = "$thisns$_"; if (my $found = $xp->find($attrib_path, $node)) { $data{$_} = "" . $found->to_literal; warn "Use of '$_' as an attribute is depricated." . " Use a child tag instead." . " To convert your file to the new version see the Docs.\n" unless $is_attrib; debug "Got $_=" . (defined $data{$_} ? $data{$_} : 'UNDEF'); } elsif ($found = $xp->find($tag_path, $node)) { if ($_ eq "extra") { my %extra; foreach ($found->pop->getAttributes) { $extra{ $_->getName } = $_->getData; } $data{$_} = \%extra; } else { $data{$_} = "" . $found->to_literal; } warn "Use of '$_' as a child tag is depricated." . " Use an attribute instead." . " To convert your file to the new version see the Docs.\n" if $is_attrib; debug "Got $_=" . (defined $data{$_} ? $data{$_} : 'UNDEF'); } } return wantarray ? %data : \%data; } 1; =pod =head1 BUGS Ignores the order attribute for Constraints, Views, Indices, Views, Triggers and Procedures, using the tag order instead. (This is the order output by the SQLFairy XML producer). =head1 SEE ALSO L, L, L, L. =head1 TODO =over 4 =item * Support options attribute. =item * Test foreign keys are parsed ok. =item * Control over defaulting. =back =head1 AUTHOR Mark D. Addison Emark.addison@itn.co.ukE, Jonathan Yu Efrequency@cpan.orgE =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/Excel.pm0000644000000000000000000001151614716630117022434 0ustar00rootroot00000000000000package SQL::Translator::Parser::Excel; =head1 NAME SQL::Translator::Parser::Excel - parser for Excel =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new; $translator->parser('Excel'); =head1 DESCRIPTION Parses an Excel spreadsheet file using Spreadsheet::ParseExcel. =head1 OPTIONS =over =item * scan_fields Indicates that the columns should be scanned to determine data types and field sizes. True by default. =back =cut use strict; use warnings; our ($DEBUG, @EXPORT_OK); $DEBUG = 0 unless defined $DEBUG; our $VERSION = '1.66'; use Spreadsheet::ParseExcel; use Exporter; use SQL::Translator::Utils qw(debug normalize_name); use base qw(Exporter); @EXPORT_OK = qw(parse); my %ET_to_ST = ( 'Text' => 'VARCHAR', 'Date' => 'DATETIME', 'Numeric' => 'DOUBLE', ); # ------------------------------------------------------------------- # parse($tr, $data) # # Note that $data, in the case of this parser, is unuseful. # Spreadsheet::ParseExcel works on files, not data streams. # ------------------------------------------------------------------- sub parse { my ($tr, $data) = @_; my $args = $tr->parser_args; my $filename = $tr->filename || return; my $wb = Spreadsheet::ParseExcel::Workbook->Parse($filename); my $schema = $tr->schema; my $table_no = 0; my $wb_count = $wb->{'SheetCount'} || 0; for my $num (0 .. $wb_count - 1) { $table_no++; my $ws = $wb->Worksheet($num); my $table_name = normalize_name($ws->{'Name'} || "Table$table_no"); my @cols = $ws->ColRange; next unless $cols[1] > 0; my $table = $schema->add_table(name => $table_name); my @field_names = (); for my $col ($cols[0] .. $cols[1]) { my $cell = $ws->Cell(0, $col); my $col_name = normalize_name($cell->{'Val'}); my $data_type = ET_to_ST($cell->{'Type'}); push @field_names, $col_name; my $field = $table->add_field( name => $col_name, data_type => $data_type, default_value => '', size => 255, is_nullable => 1, is_auto_increment => undef, ) or die $table->error; if ($col == 0) { $table->primary_key($field->name); $field->is_primary_key(1); } } # # If directed, look at every field's values to guess size and type. # unless (defined $args->{'scan_fields'} && $args->{'scan_fields'} == 0) { my %field_info = map { $_, {} } @field_names; for ( my $iR = $ws->{'MinRow'} == 0 ? 1 : $ws->{'MinRow'}; defined $ws->{'MaxRow'} && $iR <= $ws->{'MaxRow'}; $iR++ ) { for (my $iC = $ws->{'MinCol'}; defined $ws->{'MaxCol'} && $iC <= $ws->{'MaxCol'}; $iC++) { my $field = $field_names[$iC]; my $data = $ws->{'Cells'}[$iR][$iC]->{'_Value'}; next if !defined $data || $data eq ''; my $size = [ length $data ]; my $type; if ($data =~ /^-?\d+$/) { $type = 'integer'; } elsif ($data =~ /^-?[,\d]+\.[\d+]?$/ || $data =~ /^-?[,\d]+?\.\d+$/ || $data =~ /^-?\.\d+$/) { $type = 'float'; my ($w, $d) = map { s/,//g; length $_ || 1 } split(/\./, $data); $size = [ $w + $d, $d ]; } else { $type = 'char'; } for my $i (0, 1) { next unless defined $size->[$i]; my $fsize = $field_info{$field}{'size'}[$i] || 0; if ($size->[$i] > $fsize) { $field_info{$field}{'size'}[$i] = $size->[$i]; } } $field_info{$field}{$type}++; } } for my $field (keys %field_info) { my $size = $field_info{$field}{'size'} || [1]; my $data_type = $field_info{$field}{'char'} ? 'char' : $field_info{$field}{'float'} ? 'float' : $field_info{$field}{'integer'} ? 'integer' : 'char'; if ($data_type eq 'char' && scalar @$size == 2) { $size = [ $size->[0] + $size->[1] ]; } my $field = $table->get_field($field); $field->size($size) if $size; $field->data_type($data_type); } } } return 1; } sub ET_to_ST { my $et = shift; $ET_to_ST{$et} || $ET_to_ST{'Text'}; } 1; # ------------------------------------------------------------------- # Education is an admirable thing, # but it is as well to remember that # nothing that is worth knowing can be taught. # Oscar Wilde # ------------------------------------------------------------------- =pod =head1 AUTHORS Mike Mellilo , darren chamberlain Edlc@users.sourceforge.netE, Ken Y. Clark Ekclark@cpan.orgE. =head1 SEE ALSO Spreadsheet::ParseExcel, SQL::Translator. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/DB2/0000755000000000000000000000000014716630506021403 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Parser/DB2/Grammar.pm0000644000000000000000000630024214701227332023327 0ustar00rootroot00000000000000package SQL::Translator::Parser::DB2::Grammar; use Parse::RecDescent; { my $ERRORS; package Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar; use strict; use vars qw($skip $AUTOLOAD ); $skip = '\s*'; my (%tables, $table_order, @table_comments, @views, @triggers); { local $SIG{__WARN__} = sub {0}; # PRETEND TO BE IN Parse::RecDescent NAMESPACE *Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::AUTOLOAD = sub { no strict 'refs'; $AUTOLOAD =~ s/^Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar/Parse::RecDescent/; goto &{$AUTOLOAD}; } } push @Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::ISA, 'Parse::RecDescent'; # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_17_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_17_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_17_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DECIMAL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_17_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_17_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DECIMAL/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DECIMAL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DECIMAL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DEC/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_17_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_17_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DEC/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DEC)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DEC/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_17_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::triggered_action { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"triggered_action"}; Parse::RecDescent::_trace( q{Trying rule: [triggered_action]}, Parse::RecDescent::_tracefirst($_[1]), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [when_clause SQL_procedure_statement]}, Parse::RecDescent::_tracefirst($_[1]), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{triggered_action}); %item = (__RULE__ => q{triggered_action}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying repeated subrule: [when_clause]}, Parse::RecDescent::_tracefirst($text), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::when_clause, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [when_clause]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; $item{q{when_clause(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying subrule: [SQL_procedure_statement]}, Parse::RecDescent::_tracefirst($text), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{SQL_procedure_statement})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::SQL_procedure_statement( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [SQL_procedure_statement]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; $item{q{SQL_procedure_statement}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying action}, Parse::RecDescent::_tracefirst($text), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { 'condition' => $item[1][0], 'statement' => $item{'SQL_procedure_statement'} }; }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [when_clause SQL_procedure_statement]<<}, Parse::RecDescent::_tracefirst($text), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{triggered_action}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{triggered_action}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{triggered_action}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{triggered_action}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_2_of_rule_search_condition { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_2_of_rule_search_condition"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_2_of_rule_search_condition]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [predicate /SELECTIVITY/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_2_of_rule_search_condition}); %item = (__RULE__ => q{_alternation_1_of_production_2_of_rule_search_condition}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [predicate]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::predicate( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [predicate]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $item{q{predicate}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [/SELECTIVITY/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{/SELECTIVITY/i})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [predicate /SELECTIVITY/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['(' search_condition ')']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_2_of_rule_search_condition}); %item = (__RULE__ => q{_alternation_1_of_production_2_of_rule_search_condition}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [search_condition]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{search_condition})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::search_condition( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [search_condition]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $item{q{search_condition}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['(' search_condition ')']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::name1 { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"name1"}; Parse::RecDescent::_trace(q{Trying rule: [name1]}, Parse::RecDescent::_tracefirst($_[1]), q{name1}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{name1}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{name1}); %item = (__RULE__ => q{name1}); my $repcount = 0; Parse::RecDescent::_trace(q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{name1}, $tracelevel) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{name1}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{name1}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [NAME]<<}, Parse::RecDescent::_tracefirst($text), q{name1}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{name1}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{name1}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{name1}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{name1}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule_cond { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_2_of_production_1_of_rule_cond"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_2_of_production_1_of_rule_cond]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [predicate /SELECTIVITY/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule_cond}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule_cond}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [predicate]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::predicate( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [predicate]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $item{q{predicate}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [/SELECTIVITY/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{/SELECTIVITY/i})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [predicate /SELECTIVITY/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['(' search_condition ')']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule_cond}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule_cond}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [search_condition]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{search_condition})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::search_condition( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [search_condition]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $item{q{search_condition}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['(' search_condition ')']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_2_of_production_1_of_rule_cond}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_expression"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['+', or '-' function, or '(', or constant, or column_name, or host_variable, or special_register, or labeled_duration, or case_expression, or cast_specification, or OLAP_function, or method_invocation, or subtype_treatment, or sequence_reference]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying repeated subrule: ['+', or '-']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is( q{function, or '(', or constant, or column_name, or host_variable, or special_register, or labeled_duration, or case_expression, or cast_specification, or OLAP_function, or method_invocation, or subtype_treatment, or sequence_reference} )->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: ['+', or '-' function, or '(', or constant, or column_name, or host_variable, or special_register, or labeled_duration, or case_expression, or cast_specification, or OLAP_function, or method_invocation, or subtype_treatment, or sequence_reference]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::SCHEMA { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"SCHEMA"}; Parse::RecDescent::_trace(q{Trying rule: [SCHEMA]}, Parse::RecDescent::_tracefirst($_[1]), q{SCHEMA}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/\\w+/]}, Parse::RecDescent::_tracefirst($_[1]), q{SCHEMA}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{SCHEMA}); %item = (__RULE__ => q{SCHEMA}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/\\w+/]}, Parse::RecDescent::_tracefirst($text), q{SCHEMA}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:\w+)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/\\w+/]<<}, Parse::RecDescent::_tracefirst($text), q{SCHEMA}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/\\w\{1,128\}/]}, Parse::RecDescent::_tracefirst($_[1]), q{SCHEMA}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{SCHEMA}); %item = (__RULE__ => q{SCHEMA}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/\\w\{1,128\}/]}, Parse::RecDescent::_tracefirst($text), q{SCHEMA}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:\w{1,128})//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/\\w\{1,128\}/]<<}, Parse::RecDescent::_tracefirst($text), q{SCHEMA}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{SCHEMA}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{SCHEMA}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{SCHEMA}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{SCHEMA}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_87_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_87_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_87_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/VARIANCE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_87_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_87_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/VARIANCE/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:VARIANCE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/VARIANCE/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/VAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_87_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_87_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/VAR/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:VAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/VAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_87_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"} {"_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['+']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['+']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\+//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['+']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['-']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['-']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\-//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['-']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::get_bracketed { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"get_bracketed"}; Parse::RecDescent::_trace( q{Trying rule: [get_bracketed]}, Parse::RecDescent::_tracefirst($_[1]), q{get_bracketed}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: []}, Parse::RecDescent::_tracefirst($_[1]), q{get_bracketed}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{get_bracketed}); %item = (__RULE__ => q{get_bracketed}); my $repcount = 0; Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{get_bracketed}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { extract_bracketed($text, '('); }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: []<<}, Parse::RecDescent::_tracefirst($text), q{get_bracketed}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{get_bracketed}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{get_bracketed}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{get_bracketed}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{get_bracketed}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::labeled_duration { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"labeled_duration"}; Parse::RecDescent::_trace( q{Trying rule: [labeled_duration]}, Parse::RecDescent::_tracefirst($_[1]), q{labeled_duration}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [ld_type ld_duration]}, Parse::RecDescent::_tracefirst($_[1]), q{labeled_duration}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{labeled_duration}); %item = (__RULE__ => q{labeled_duration}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [ld_type]}, Parse::RecDescent::_tracefirst($text), q{labeled_duration}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::ld_type( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{labeled_duration}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [ld_type]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{labeled_duration}, $tracelevel ) if defined $::RD_TRACE; $item{q{ld_type}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [ld_duration]}, Parse::RecDescent::_tracefirst($text), q{labeled_duration}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{ld_duration})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::ld_duration( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{labeled_duration}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [ld_duration]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{labeled_duration}, $tracelevel ) if defined $::RD_TRACE; $item{q{ld_duration}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [ld_type ld_duration]<<}, Parse::RecDescent::_tracefirst($text), q{labeled_duration}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{labeled_duration}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{labeled_duration}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{labeled_duration}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{labeled_duration}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::group_end { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"group_end"}; Parse::RecDescent::_trace( q{Trying rule: [group_end]}, Parse::RecDescent::_tracefirst($_[1]), q{group_end}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/UNBOUNDED\\s+PRECEDING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_end}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{group_end}); %item = (__RULE__ => q{group_end}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/UNBOUNDED\\s+PRECEDING/i]}, Parse::RecDescent::_tracefirst($text), q{group_end}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:UNBOUNDED\s+PRECEDING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/UNBOUNDED\\s+PRECEDING/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_end}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [unsigned_constant /FOLLOWING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_end}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{group_end}); %item = (__RULE__ => q{group_end}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [unsigned_constant]}, Parse::RecDescent::_tracefirst($text), q{group_end}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::unsigned_constant( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{group_end}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [unsigned_constant]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{group_end}, $tracelevel ) if defined $::RD_TRACE; $item{q{unsigned_constant}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/FOLLOWING/i]}, Parse::RecDescent::_tracefirst($text), q{group_end}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/FOLLOWING/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:FOLLOWING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [unsigned_constant /FOLLOWING/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_end}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{group_end}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{group_end}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{group_end}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{group_end}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::statement { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"statement"}; Parse::RecDescent::_trace( q{Trying rule: [statement]}, Parse::RecDescent::_tracefirst($_[1]), q{statement}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [comment]}, Parse::RecDescent::_tracefirst($_[1]), q{statement}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{statement}); %item = (__RULE__ => q{statement}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [comment]}, Parse::RecDescent::_tracefirst($text), q{statement}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::comment( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{statement}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [comment]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{statement}, $tracelevel ) if defined $::RD_TRACE; $item{q{comment}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [comment]<<}, Parse::RecDescent::_tracefirst($text), q{statement}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [create]}, Parse::RecDescent::_tracefirst($_[1]), q{statement}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{statement}); %item = (__RULE__ => q{statement}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [create]}, Parse::RecDescent::_tracefirst($text), q{statement}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::create( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{statement}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [create]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{statement}, $tracelevel ) if defined $::RD_TRACE; $item{q{create}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [create]<<}, Parse::RecDescent::_tracefirst($text), q{statement}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched) { Parse::RecDescent::_trace( q{Trying production: []}, Parse::RecDescent::_tracefirst($_[1]), q{statement}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; my $_savetext; @item = (q{statement}); %item = (__RULE__ => q{statement}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying directive: []}, Parse::RecDescent::_tracefirst($text), q{statement}, $tracelevel ) if defined $::RD_TRACE; $_tok = do { if (1) { do { my $rule = $item[0]; $rule =~ s/_/ /g; #WAS: Parse::RecDescent::_error("Invalid $rule: " . $expectation->message() ,$thisline); push @{ $thisparser->{errors} }, [ "Invalid $rule: " . $expectation->message(), $thisline ]; } unless $_noactions; undef; } else { 0; } }; if (defined($_tok)) { Parse::RecDescent::_trace(q{>>Matched directive<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; } else { Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; } last unless defined $_tok; push @item, $item{__DIRECTIVE1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: []<<}, Parse::RecDescent::_tracefirst($text), q{statement}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{statement}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{statement}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{statement}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{statement}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"} {"_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [result_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [result_expression]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::result_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [result_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{result_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [result_expression]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NULL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NULL/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NULL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/NULL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule_case_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_2_of_production_1_of_rule_case_expression"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_2_of_production_1_of_rule_case_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ELSE\\s+NULL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule_case_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule_case_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ELSE\\s+NULL/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ELSE\s+NULL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ELSE\\s+NULL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ELSE/i result_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule_case_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule_case_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ELSE/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ELSE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [result_expression]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{result_expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::result_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [result_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{result_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/ELSE/i result_expression]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_2_of_production_1_of_rule_case_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::subject_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"subject_expression"}; Parse::RecDescent::_trace( q{Trying rule: [subject_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{subject_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [expression]}, Parse::RecDescent::_tracefirst($_[1]), q{subject_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{subject_expression}); %item = (__RULE__ => q{subject_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{subject_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{subject_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{subject_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying action}, Parse::RecDescent::_tracefirst($text), q{subject_expression}, $tracelevel ) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { # with static result type that is a used-defined struct type }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [expression]<<}, Parse::RecDescent::_tracefirst($text), q{subject_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{subject_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{subject_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{subject_expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{subject_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_desc_option { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_desc_option"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_desc_option]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NULLS\\s+FIRST/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_desc_option}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_desc_option}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NULLS\\s+FIRST/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NULLS\s+FIRST)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/NULLS\\s+FIRST/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NULLS\\s+LAST/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_desc_option}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_desc_option}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NULLS\\s+LAST/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NULLS\s+LAST)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/NULLS\\s+LAST/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_desc_option}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::view_name { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"view_name"}; Parse::RecDescent::_trace( q{Trying rule: [view_name]}, Parse::RecDescent::_tracefirst($_[1]), q{view_name}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [SCHEMA '.' NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{view_name}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{view_name}); %item = (__RULE__ => q{view_name}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [SCHEMA]}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::SCHEMA( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [SCHEMA]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{SCHEMA}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: ['.']}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'.'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\.//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{NAME})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { schema => $item[1], name => $item[3] } }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [SCHEMA '.' NAME]<<}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{view_name}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{view_name}); %item = (__RULE__ => q{view_name}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { name => $item[1] } }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [NAME]<<}, Parse::RecDescent::_tracefirst($text), q{view_name}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{view_name}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{view_name}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{view_name}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{view_name}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_cond { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_cond"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_cond]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/AND/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_cond}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_cond}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/AND/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:AND)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/AND/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/OR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_cond}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_cond}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/OR/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:OR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/OR/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_cond}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::numbering_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"numbering_function"}; Parse::RecDescent::_trace( q{Trying rule: [numbering_function]}, Parse::RecDescent::_tracefirst($_[1]), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ROW_NUMBER|ROWNUMBER/i '()' /OVER/i '(' window_partition_clause window_order_clause /RANGE\\s+BETWEEN\\s+UNBOUNDED\\s+PRECEDING\\s+AND\\s+UNBBOUNDED\\s+FOLLOWING/i, or window_aggregation_group_clause ')']}, Parse::RecDescent::_tracefirst($_[1]), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{numbering_function}); %item = (__RULE__ => q{numbering_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ROW_NUMBER|ROWNUMBER/i]}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ROW_NUMBER|ROWNUMBER)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['()']}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'()'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: [/OVER/i]}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/OVER/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:OVER)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'('})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{Trying repeated subrule: [window_partition_clause]}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{window_partition_clause})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::window_partition_clause, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [window_partition_clause]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{window_partition_clause(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying repeated subrule: [window_order_clause]}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{window_order_clause})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_numbering_function, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule_numbering_function]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_numbering_function(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying repeated subrule: [/RANGE\\s+BETWEEN\\s+UNBOUNDED\\s+PRECEDING\\s+AND\\s+UNBBOUNDED\\s+FOLLOWING/i, or window_aggregation_group_clause]}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->is( q{/RANGE\\s+BETWEEN\\s+UNBOUNDED\\s+PRECEDING\\s+AND\\s+UNBBOUNDED\\s+FOLLOWING/i, or window_aggregation_group_clause} )->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule_numbering_function, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_2_of_production_1_of_rule_numbering_function]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_2_of_production_1_of_rule_numbering_function(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING3__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ROW_NUMBER|ROWNUMBER/i '()' /OVER/i '(' window_partition_clause window_order_clause /RANGE\\s+BETWEEN\\s+UNBOUNDED\\s+PRECEDING\\s+AND\\s+UNBBOUNDED\\s+FOLLOWING/i, or window_aggregation_group_clause ')']<<}, Parse::RecDescent::_tracefirst($text), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{numbering_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{numbering_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{numbering_function}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{numbering_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_window_aggregation_group_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_window_aggregation_group_clause"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_window_aggregation_group_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ROWS/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ROWS/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ROWS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ROWS/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/RANGE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/RANGE/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:RANGE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/RANGE/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::group_bound1 { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"group_bound1"}; Parse::RecDescent::_trace( q{Trying rule: [group_bound1]}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/UNBOUNDED\\s+PRECEDING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{group_bound1}); %item = (__RULE__ => q{group_bound1}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/UNBOUNDED\\s+PRECEDING/i]}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:UNBOUNDED\s+PRECEDING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/UNBOUNDED\\s+PRECEDING/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [unsigned_constant /PRECEDING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{group_bound1}); %item = (__RULE__ => q{group_bound1}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [unsigned_constant]}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::unsigned_constant( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [unsigned_constant]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $item{q{unsigned_constant}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/PRECEDING/i]}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/PRECEDING/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:PRECEDING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [unsigned_constant /PRECEDING/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [unsigned_constant /FOLLOWING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{group_bound1}); %item = (__RULE__ => q{group_bound1}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [unsigned_constant]}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::unsigned_constant( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [unsigned_constant]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $item{q{unsigned_constant}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/FOLLOWING/i]}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/FOLLOWING/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:FOLLOWING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [unsigned_constant /FOLLOWING/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CURRENT\\s+ROW/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[3]; $text = $_[1]; my $_savetext; @item = (q{group_bound1}); %item = (__RULE__ => q{group_bound1}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CURRENT\\s+ROW/i]}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CURRENT\s+ROW)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CURRENT\\s+ROW/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound1}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{group_bound1}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{group_bound1}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{group_bound1}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::OLAP_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"OLAP_function"}; Parse::RecDescent::_trace( q{Trying rule: [OLAP_function]}, Parse::RecDescent::_tracefirst($_[1]), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [ranking_function]}, Parse::RecDescent::_tracefirst($_[1]), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{OLAP_function}); %item = (__RULE__ => q{OLAP_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [ranking_function]}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::ranking_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [ranking_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{ranking_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [ranking_function]<<}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [numbering_function]}, Parse::RecDescent::_tracefirst($_[1]), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{OLAP_function}); %item = (__RULE__ => q{OLAP_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [numbering_function]}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::numbering_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [numbering_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{numbering_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [numbering_function]<<}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [aggregation_function]}, Parse::RecDescent::_tracefirst($_[1]), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{OLAP_function}); %item = (__RULE__ => q{OLAP_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [aggregation_function]}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::aggregation_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [aggregation_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{aggregation_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [aggregation_function]<<}, Parse::RecDescent::_tracefirst($text), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{OLAP_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{OLAP_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{OLAP_function}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{OLAP_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_30_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_30_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_30_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DOUBLE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_30_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_30_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DOUBLE/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DOUBLE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DOUBLE/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DOUBLE_PRECISION/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_30_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_30_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DOUBLE_PRECISION/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DOUBLE_PRECISION)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DOUBLE_PRECISION/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_30_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::FULL { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"FULL"}; Parse::RecDescent::_trace(q{Trying rule: [FULL]}, Parse::RecDescent::_tracefirst($_[1]), q{FULL}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/full/i]}, Parse::RecDescent::_tracefirst($_[1]), q{FULL}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{FULL}); %item = (__RULE__ => q{FULL}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/full/i]}, Parse::RecDescent::_tracefirst($text), q{FULL}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:full)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/full/i]<<}, Parse::RecDescent::_tracefirst($text), q{FULL}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{FULL}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{FULL}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{FULL}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{FULL}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule_cast_specification { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_2_of_production_1_of_rule_cast_specification"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_2_of_production_1_of_rule_cast_specification]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SCOPE/ typed_table_name, or typed_view_name]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule_cast_specification}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule_cast_specification}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SCOPE/]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SCOPE)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{typed_table_name, or typed_view_name}) ->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/SCOPE/ typed_table_name, or typed_view_name]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::case_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"case_expression"}; Parse::RecDescent::_trace( q{Trying rule: [case_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CASE/i searched_when_clause, or simple_when_clause /ELSE\\s+NULL/i, or /ELSE/i /END/i]}, Parse::RecDescent::_tracefirst($_[1]), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{case_expression}); %item = (__RULE__ => q{case_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CASE/i]}, Parse::RecDescent::_tracefirst($text), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CASE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_case_expression]}, Parse::RecDescent::_tracefirst($text), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{searched_when_clause, or simple_when_clause}) ->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_case_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_case_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_case_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [/ELSE\\s+NULL/i, or /ELSE/i]}, Parse::RecDescent::_tracefirst($text), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{/ELSE\\s+NULL/i, or /ELSE/i})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule_case_expression, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_2_of_production_1_of_rule_case_expression]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_2_of_production_1_of_rule_case_expression(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying terminal: [/END/i]}, Parse::RecDescent::_tracefirst($text), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/END/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:END)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CASE/i searched_when_clause, or simple_when_clause /ELSE\\s+NULL/i, or /ELSE/i /END/i]<<}, Parse::RecDescent::_tracefirst($text), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{case_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{case_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{case_expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{case_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::operator { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"operator"}; Parse::RecDescent::_trace( q{Trying rule: [operator]}, Parse::RecDescent::_tracefirst($_[1]), q{operator}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CONCAT/i, or '||']}, Parse::RecDescent::_tracefirst($_[1]), q{operator}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{operator}); %item = (__RULE__ => q{operator}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_operator]}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_operator( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_operator]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_operator}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/CONCAT/i, or '||']<<}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['/']}, Parse::RecDescent::_tracefirst($_[1]), q{operator}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{operator}); %item = (__RULE__ => q{operator}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['/']}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\///) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['/']<<}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['*']}, Parse::RecDescent::_tracefirst($_[1]), q{operator}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{operator}); %item = (__RULE__ => q{operator}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['*']}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\*//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['*']<<}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['+']}, Parse::RecDescent::_tracefirst($_[1]), q{operator}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[3]; $text = $_[1]; my $_savetext; @item = (q{operator}); %item = (__RULE__ => q{operator}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['+']}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\+//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['+']<<}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['-']}, Parse::RecDescent::_tracefirst($_[1]), q{operator}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[4]; $text = $_[1]; my $_savetext; @item = (q{operator}); %item = (__RULE__ => q{operator}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['-']}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\-//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['-']<<}, Parse::RecDescent::_tracefirst($text), q{operator}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{operator}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{operator}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{operator}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{operator}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_2_of_rule_type { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_2_of_rule_type"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_2_of_rule_type]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/INSERT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_2_of_rule_type}); %item = (__RULE__ => q{_alternation_1_of_production_2_of_rule_type}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/INSERT/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:INSERT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/INSERT/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DELETE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_2_of_rule_type}); %item = (__RULE__ => q{_alternation_1_of_production_2_of_rule_type}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DELETE/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DELETE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DELETE/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/UPDATE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_2_of_rule_type}); %item = (__RULE__ => q{_alternation_1_of_production_2_of_rule_type}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/UPDATE/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:UPDATE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/UPDATE/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_2_of_rule_type}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_2_of_rule_type}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_8_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_8_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_8_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CONCAT/]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_8_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_8_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CONCAT/]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CONCAT)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CONCAT/]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['||']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_8_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_8_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['||']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\|\|//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['||']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_8_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::sequence_reference { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"sequence_reference"}; Parse::RecDescent::_trace( q{Trying rule: [sequence_reference]}, Parse::RecDescent::_tracefirst($_[1]), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [nextval_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{sequence_reference}); %item = (__RULE__ => q{sequence_reference}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [nextval_expression]}, Parse::RecDescent::_tracefirst($text), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::nextval_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [nextval_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; $item{q{nextval_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [nextval_expression]<<}, Parse::RecDescent::_tracefirst($text), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [prevval_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{sequence_reference}); %item = (__RULE__ => q{sequence_reference}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [prevval_expression]}, Parse::RecDescent::_tracefirst($text), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::prevval_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [prevval_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; $item{q{prevval_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [prevval_expression]<<}, Parse::RecDescent::_tracefirst($text), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{sequence_reference}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{sequence_reference}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{sequence_reference}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{sequence_reference}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ABS/i, or /ABSVAL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/ABS/i, or /ABSVAL/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/AVG/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/AVG/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:AVG)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/AVG/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/BIGINT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/BIGINT/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:BIGINT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/BIGINT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/BLOB/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[3]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/BLOB/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:BLOB)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/BLOB/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CHAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[4]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CHAR/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CHAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CHAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CLOB/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[5]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CLOB/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CLOB)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CLOB/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/COALESCE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[6]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/COALESCE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:COALESCE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/COALESCE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CONCAT/, or '||']}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[7]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_8_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_8_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_8_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_8_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/CONCAT/, or '||']<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CORRELATION/i, or /CORR/]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[8]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_9_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_9_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_9_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_9_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/CORRELATION/i, or /CORR/]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/COUNT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[9]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/COUNT/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:COUNT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/COUNT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/COUNT_BIG/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[10]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/COUNT_BIG/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:COUNT_BIG)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/COUNT_BIG/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/COVARIANCE/i, or /COVAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[11]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_12_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_12_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_12_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_12_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/COVARIANCE/i, or /COVAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DATE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[12]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DATE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DATE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DATE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DAY/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[13]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DAY/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DAY)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DAY/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DAYS/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[14]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DAYS/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DAYS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DAYS/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DBCLOB/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[15]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DBCLOB/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DBCLOB)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DBCLOB/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DECIMAL/i, or /DEC/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[16]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_17_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_17_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_17_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_17_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/DECIMAL/i, or /DEC/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DECRYPT_BIN/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[17]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DECRYPT_BIN/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DECRYPT_BIN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DECRYPT_BIN/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DECRYPT_CHAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[18]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DECRYPT_CHAR/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DECRYPT_CHAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DECRYPT_CHAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DEREF/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[19]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DEREF/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DEREF)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DEREF/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DIGITS/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[20]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DIGITS/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DIGITS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DIGITS/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DLCOMMENT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[21]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DLCOMMENT/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DLCOMMENT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DLCOMMENT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DLLINKTYPE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[22]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DLLINKTYPE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DLLINKTYPE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DLLINKTYPE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DLURLCOMPLETE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[23]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DLURLCOMPLETE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DLURLCOMPLETE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DLURLCOMPLETE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DLURLPATH/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[24]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DLURLPATH/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DLURLPATH)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DLURLPATH/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DLURLPATHONLY/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[25]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DLURLPATHONLY/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DLURLPATHONLY)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DLURLPATHONLY/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DLURLSCHEME/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[26]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DLURLSCHEME/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DLURLSCHEME)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DLURLSCHEME/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DLURLSERVER/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[27]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DLURLSERVER/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DLURLSERVER)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DLURLSERVER/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DLVALUE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[28]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DLVALUE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DLVALUE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DLVALUE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DOUBLE/i, or /DOUBLE_PRECISION/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[29]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_30_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_30_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_30_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_30_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/DOUBLE/i, or /DOUBLE_PRECISION/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ENCRYPT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[30]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ENCRYPT/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ENCRYPT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ENCRYPT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/EVENT_MON_STATE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[31]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/EVENT_MON_STATE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:EVENT_MON_STATE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/EVENT_MON_STATE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/FLOAT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[32]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/FLOAT/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:FLOAT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/FLOAT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/GETHINT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[33]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/GETHINT/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:GETHINT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/GETHINT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/GENERATE_UNIQUE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[34]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/GENERATE_UNIQUE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:GENERATE_UNIQUE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/GENERATE_UNIQUE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/GRAPHIC/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[35]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/GRAPHIC/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:GRAPHIC)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/GRAPHIC/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/GROUPING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[36]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/GROUPING/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:GROUPING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/GROUPING/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/HEX/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[37]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/HEX/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:HEX)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/HEX/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/HOUR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[38]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/HOUR/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:HOUR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/HOUR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/IDENTITY_VAL_LOCAL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[39]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/IDENTITY_VAL_LOCAL/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:IDENTITY_VAL_LOCAL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/IDENTITY_VAL_LOCAL/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/INTEGER/i, or /INT/]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[40]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_41_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_41_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_41_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_41_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/INTEGER/i, or /INT/]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LCASE/i, or /LOWER/]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[41]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_42_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_42_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_42_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_42_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/LCASE/i, or /LOWER/]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LENGTH/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[42]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LENGTH/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LENGTH)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LENGTH/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LONG_VARCHAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[43]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LONG_VARCHAR/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LONG_VARCHAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LONG_VARCHAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LONG_VARGRAPHIC/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[44]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LONG_VARGRAPHIC/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LONG_VARGRAPHIC)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LONG_VARGRAPHIC/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LTRIM/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[45]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LTRIM/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LTRIM)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LTRIM/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MAX/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[46]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MAX/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MAX)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MAX/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MICROSECOND/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[47]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MICROSECOND/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MICROSECOND)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MICROSECOND/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MIN/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[48]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MIN/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MIN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MIN/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MINUTE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[49]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MINUTE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MINUTE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MINUTE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MONTH/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[50]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MONTH/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MONTH)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MONTH/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MULTIPLY_ACT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[51]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MULTIPLY_ACT/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MULTIPLY_ACT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MULTIPLY_ACT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NODENUMBER/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[52]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NODENUMBER/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NODENUMBER)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/NODENUMBER/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NULLIF/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[53]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NULLIF/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NULLIF)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/NULLIF/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/PARTITON/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[54]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/PARTITON/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:PARTITON)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/PARTITON/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/POSSTR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[55]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/POSSTR/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:POSSTR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/POSSTR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/RAISE_ERROR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[56]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/RAISE_ERROR/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:RAISE_ERROR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/RAISE_ERROR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REAL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[57]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REAL/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REAL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REAL/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REC2XML/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[58]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REC2XML/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REC2XML)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REC2XML/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_AVGX/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[59]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REGR_AVGX/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REGR_AVGX)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REGR_AVGX/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_AVGY/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[60]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REGR_AVGY/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REGR_AVGY)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REGR_AVGY/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_COUNT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[61]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REGR_COUNT/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REGR_COUNT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REGR_COUNT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_INTERCEPT/i, or /REGR_ICPT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[62]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_63_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_63_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_63_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_63_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/REGR_INTERCEPT/i, or /REGR_ICPT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_R2/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[63]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REGR_R2/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REGR_R2)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REGR_R2/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_SLOPE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[64]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REGR_SLOPE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REGR_SLOPE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REGR_SLOPE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_SXX/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[65]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REGR_SXX/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REGR_SXX)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REGR_SXX/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_SXY/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[66]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REGR_SXY/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REGR_SXY)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REGR_SXY/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_SYY/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[67]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REGR_SYY/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REGR_SYY)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REGR_SYY/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/RTRIM/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[68]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/RTRIM/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:RTRIM)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/RTRIM/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SECOND/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[69]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SECOND/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SECOND)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SECOND/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SMALLINT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[70]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SMALLINT/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SMALLINT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SMALLINT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/STDDEV/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[71]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/STDDEV/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:STDDEV)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/STDDEV/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SUBSTR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[72]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SUBSTR/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SUBSTR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SUBSTR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SUM/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[73]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SUM/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SUM)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SUM/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TABLE_NAME/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[74]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TABLE_NAME/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TABLE_NAME)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TABLE_NAME/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TABLE_SCHEMA/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[75]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TABLE_SCHEMA/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TABLE_SCHEMA)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TABLE_SCHEMA/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TIME/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[76]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TIME/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TIME)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TIME/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TIMESTAMP/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[77]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TIMESTAMP/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TIMESTAMP)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TIMESTAMP/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TRANSLATE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[78]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TRANSLATE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TRANSLATE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TRANSLATE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TYPE_ID/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[79]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TYPE_ID/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TYPE_ID)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TYPE_ID/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TYPE_NAME/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[80]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TYPE_NAME/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TYPE_NAME)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TYPE_NAME/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TYPE_SCHEMA/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[81]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TYPE_SCHEMA/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TYPE_SCHEMA)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TYPE_SCHEMA/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/UCASE/i, or /UPPER/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[82]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_83_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_83_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_83_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_83_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/UCASE/i, or /UPPER/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/VALUE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[83]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/VALUE/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:VALUE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/VALUE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/VARCHAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[84]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/VARCHAR/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:VARCHAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/VARCHAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/VARGRAPHIC/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[85]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/VARGRAPHIC/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:VARGRAPHIC)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/VARGRAPHIC/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/VARIANCE/i, or /VAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[86]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_87_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_87_of_rule_sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_87_of_rule_sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_87_of_rule_sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/VARIANCE/i, or /VAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/YEAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[87]; $text = $_[1]; my $_savetext; @item = (q{sysibm_function}); %item = (__RULE__ => q{sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/YEAR/i]}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:YEAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/YEAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{sysibm_function}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::window_partition_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"window_partition_clause"}; Parse::RecDescent::_trace( q{Trying rule: [window_partition_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/PARTITION\\s+BY/i ]}, Parse::RecDescent::_tracefirst($_[1]), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{window_partition_clause}); %item = (__RULE__ => q{window_partition_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/PARTITION\\s+BY/i]}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:PARTITION\s+BY)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying operator: []}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->is( q{} )->at($text); $_tok = undef; OPLOOP: while (1) { $repcount = 0; my @item; # MATCH LEFTARG Parse::RecDescent::_trace( q{Trying subrule: [partitioning_expression]}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{partitioning_expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::partitioning_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [partitioning_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{partitioning_expression}} = $_tok; push @item, $_tok; } $repcount++; my $savetext = $text; my $backtrack; # MATCH (OP RIGHTARG)(s) while ($repcount < 100000000) { $backtrack = 0; Parse::RecDescent::_trace( q{Trying terminal: [/,/]}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/,/})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:,)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; pop @item; if (defined $1) { push @item, $item{'partitioning_expression(s)'} = $1; $backtrack = 1; } Parse::RecDescent::_trace( q{Trying subrule: [partitioning_expression]}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{partitioning_expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::partitioning_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [partitioning_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{partitioning_expression}} = $_tok; push @item, $_tok; } $savetext = $text; $repcount++; } $text = $savetext; pop @item if $backtrack; unless (@item) { undef $_tok; last } $_tok = [@item]; last; } unless ($repcount >= 1) { Parse::RecDescent::_trace( q{<]>>}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched operator: []<< (return value: [} . qq{@{$_tok||[]}} . q{]}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; push @item, $item{'partitioning_expression(s)'} = $_tok || []; Parse::RecDescent::_trace( q{>>Matched production: [/PARTITION\\s+BY/i ]<<}, Parse::RecDescent::_tracefirst($text), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{window_partition_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{window_partition_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{window_partition_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{window_partition_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::WHERE { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"WHERE"}; Parse::RecDescent::_trace(q{Trying rule: [WHERE]}, Parse::RecDescent::_tracefirst($_[1]), q{WHERE}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/where/i]}, Parse::RecDescent::_tracefirst($_[1]), q{WHERE}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{WHERE}); %item = (__RULE__ => q{WHERE}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/where/i]}, Parse::RecDescent::_tracefirst($text), q{WHERE}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:where)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/where/i]<<}, Parse::RecDescent::_tracefirst($text), q{WHERE}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{WHERE}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{WHERE}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{WHERE}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{WHERE}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::CREATE { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"CREATE"}; Parse::RecDescent::_trace(q{Trying rule: [CREATE]}, Parse::RecDescent::_tracefirst($_[1]), q{CREATE}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/create/i]}, Parse::RecDescent::_tracefirst($_[1]), q{CREATE}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{CREATE}); %item = (__RULE__ => q{CREATE}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/create/i]}, Parse::RecDescent::_tracefirst($text), q{CREATE}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:create)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/create/i]<<}, Parse::RecDescent::_tracefirst($text), q{CREATE}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{CREATE}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{CREATE}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{CREATE}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{CREATE}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_sysfun { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_sysfun"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_sysfun]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ABS/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_sysfun}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ABS/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ABS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ABS/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ABSVAL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_sysfun}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ABSVAL/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ABSVAL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ABSVAL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_sysfun}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SYSIBM\\.|/i sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_function}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SYSIBM\\.|/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SYSIBM\.|)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [sysibm_function]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{sysibm_function})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::sysibm_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [sysibm_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{sysibm_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/SYSIBM\\.|/i sysibm_function]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SYSFUN\\.|/i sysfun_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_function}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SYSFUN\\.|/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SYSFUN\.|)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [sysfun_function]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{sysfun_function})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::sysfun_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [sysfun_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{sysfun_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/SYSFUN\\.|/i sysfun_function]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [userdefined_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_function}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [userdefined_function]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::userdefined_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [userdefined_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{userdefined_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [userdefined_function]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::identifier { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"identifier"}; Parse::RecDescent::_trace( q{Trying rule: [identifier]}, Parse::RecDescent::_tracefirst($_[1]), q{identifier}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{identifier}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{identifier}); %item = (__RULE__ => q{identifier}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{identifier}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{identifier}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{identifier}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [NAME]<<}, Parse::RecDescent::_tracefirst($text), q{identifier}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{identifier}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{identifier}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{identifier}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{identifier}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"} {"_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [asc_option]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [asc_option]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::asc_option( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [asc_option]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{asc_option}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [asc_option]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [desc_option]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [desc_option]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::desc_option( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [desc_option]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{desc_option}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [desc_option]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::result_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"result_expression"}; Parse::RecDescent::_trace( q{Trying rule: [result_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{result_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [expression]}, Parse::RecDescent::_tracefirst($_[1]), q{result_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{result_expression}); %item = (__RULE__ => q{result_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{result_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{result_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{result_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [expression]<<}, Parse::RecDescent::_tracefirst($text), q{result_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{result_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{result_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{result_expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{result_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::scoped_reference_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"scoped_reference_expression"}; Parse::RecDescent::_trace( q{Trying rule: [scoped_reference_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{scoped_reference_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [expression]}, Parse::RecDescent::_tracefirst($_[1]), q{scoped_reference_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{scoped_reference_expression}); %item = (__RULE__ => q{scoped_reference_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{scoped_reference_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{scoped_reference_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{scoped_reference_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying action}, Parse::RecDescent::_tracefirst($text), q{scoped_reference_expression}, $tracelevel ) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { # scoped, reference }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [expression]<<}, Parse::RecDescent::_tracefirst($text), q{scoped_reference_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{scoped_reference_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{scoped_reference_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{scoped_reference_expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{scoped_reference_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"} {"_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [typed_table_name]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [typed_table_name]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::typed_table_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [typed_table_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $item{q{typed_table_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [typed_table_name]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [typed_view_name]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [typed_view_name]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::typed_view_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [typed_view_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $item{q{typed_view_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [typed_view_name]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::when_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"when_clause"}; Parse::RecDescent::_trace( q{Trying rule: [when_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{when_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/WHEN/i '(' search_condition ')']}, Parse::RecDescent::_tracefirst($_[1]), q{when_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{when_clause}); %item = (__RULE__ => q{when_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/WHEN/i]}, Parse::RecDescent::_tracefirst($text), q{when_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:WHEN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{when_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'('})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [search_condition]}, Parse::RecDescent::_tracefirst($text), q{when_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{search_condition})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::search_condition( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{when_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [search_condition]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{when_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{search_condition}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{when_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{when_clause}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = $item[3] }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/WHEN/i '(' search_condition ')']<<}, Parse::RecDescent::_tracefirst($text), q{when_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{when_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{when_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{when_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{when_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_asc_option { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_asc_option"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_asc_option]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NULLS\\s+FIRST/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_asc_option}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_asc_option}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NULLS\\s+FIRST/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NULLS\s+FIRST)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/NULLS\\s+FIRST/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NULLS\\s+LAST/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_asc_option}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_asc_option}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NULLS\\s+LAST/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NULLS\s+LAST)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/NULLS\\s+LAST/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_asc_option}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::sequence_name { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"sequence_name"}; Parse::RecDescent::_trace( q{Trying rule: [sequence_name]}, Parse::RecDescent::_tracefirst($_[1]), q{sequence_name}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{sequence_name}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{sequence_name}); %item = (__RULE__ => q{sequence_name}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{sequence_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sequence_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sequence_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [NAME]<<}, Parse::RecDescent::_tracefirst($text), q{sequence_name}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{sequence_name}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{sequence_name}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{sequence_name}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{sequence_name}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::ld_duration { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"ld_duration"}; Parse::RecDescent::_trace( q{Trying rule: [ld_duration]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/YEARS?/i]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{ld_duration}); %item = (__RULE__ => q{ld_duration}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/YEARS?/i]}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:YEARS?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/YEARS?/i]<<}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MONTHS?/i]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{ld_duration}); %item = (__RULE__ => q{ld_duration}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MONTHS?/i]}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MONTHS?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MONTHS?/i]<<}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DAYS?/i]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{ld_duration}); %item = (__RULE__ => q{ld_duration}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DAYS?/i]}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DAYS?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DAYS?/i]<<}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/HOURS?/i]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[3]; $text = $_[1]; my $_savetext; @item = (q{ld_duration}); %item = (__RULE__ => q{ld_duration}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/HOURS?/i]}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:HOURS?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/HOURS?/i]<<}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MINUTES?/i]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[4]; $text = $_[1]; my $_savetext; @item = (q{ld_duration}); %item = (__RULE__ => q{ld_duration}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MINUTES?/i]}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MINUTES?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MINUTES?/i]<<}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SECONDS?/i]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[5]; $text = $_[1]; my $_savetext; @item = (q{ld_duration}); %item = (__RULE__ => q{ld_duration}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SECONDS?/i]}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SECONDS?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SECONDS?/i]<<}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MICROSECONDS?/i]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[6]; $text = $_[1]; my $_savetext; @item = (q{ld_duration}); %item = (__RULE__ => q{ld_duration}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MICROSECONDS?/i]}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MICROSECONDS?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MICROSECONDS?/i]<<}, Parse::RecDescent::_tracefirst($text), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{ld_duration}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{ld_duration}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{ld_duration}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{ld_duration}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::reference_a { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"reference_a"}; Parse::RecDescent::_trace( q{Trying rule: [reference_a]}, Parse::RecDescent::_tracefirst($_[1]), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REFERENCING/i old_new_corr old_new_table]}, Parse::RecDescent::_tracefirst($_[1]), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{reference_a}); %item = (__RULE__ => q{reference_a}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REFERENCING/i]}, Parse::RecDescent::_tracefirst($text), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REFERENCING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying repeated subrule: [old_new_corr]}, Parse::RecDescent::_tracefirst($text), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{old_new_corr})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::old_new_corr, 0, 2, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [old_new_corr]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; $item{q{old_new_corr(0..2)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying repeated subrule: [old_new_table]}, Parse::RecDescent::_tracefirst($text), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{old_new_table})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::old_new_table, 0, 2, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [old_new_table]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; $item{q{old_new_table(0..2)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{reference_a}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = join(' ', $item[1], join(' ', @{ $item[2] }), join(' ', @{ $item[3] })); }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/REFERENCING/i old_new_corr old_new_table]<<}, Parse::RecDescent::_tracefirst($text), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{reference_a}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{reference_a}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{reference_a}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{reference_a}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::cast_specification { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"cast_specification"}; Parse::RecDescent::_trace( q{Trying rule: [cast_specification]}, Parse::RecDescent::_tracefirst($_[1]), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CAST/i '(' expression, or /NULL/i, or parameter_marker /AS/i data_type /SCOPE/ ')']}, Parse::RecDescent::_tracefirst($_[1]), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{cast_specification}); %item = (__RULE__ => q{cast_specification}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CAST/i]}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CAST)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'('})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_cast_specification]}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{expression, or /NULL/i, or parameter_marker}) ->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_cast_specification( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_cast_specification]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_cast_specification}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/AS/i]}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/AS/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:AS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [data_type]}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{data_type})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::data_type( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [data_type]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $item{q{data_type}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [/SCOPE/]}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{/SCOPE/})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule_cast_specification, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_2_of_production_1_of_rule_cast_specification]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_2_of_production_1_of_rule_cast_specification(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CAST/i '(' expression, or /NULL/i, or parameter_marker /AS/i data_type /SCOPE/ ')']<<}, Parse::RecDescent::_tracefirst($text), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{cast_specification}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{cast_specification}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{cast_specification}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{cast_specification}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::type { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"type"}; Parse::RecDescent::_trace(q{Trying rule: [type]}, Parse::RecDescent::_tracefirst($_[1]), q{type}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/UPDATE/i /OF/i ]}, Parse::RecDescent::_tracefirst($_[1]), q{type}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{type}); %item = (__RULE__ => q{type}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/UPDATE/i]}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:UPDATE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: [/OF/i]}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/OF/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:OF)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying operator: []}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{}) ->at($text); $_tok = undef; OPLOOP: while (1) { $repcount = 0; my @item; # MATCH LEFTARG Parse::RecDescent::_trace( q{Trying subrule: [column_name]}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{column_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [column_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $item{q{column_name}} = $_tok; push @item, $_tok; } $repcount++; my $savetext = $text; my $backtrack; # MATCH (OP RIGHTARG)(s) while ($repcount < 100000000) { $backtrack = 0; Parse::RecDescent::_trace( q{Trying terminal: [/,/]}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/,/})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:,)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN3__} = $&; pop @item; if (defined $1) { push @item, $item{'column_name(s)'} = $1; $backtrack = 1; } Parse::RecDescent::_trace( q{Trying subrule: [column_name]}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{column_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [column_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $item{q{column_name}} = $_tok; push @item, $_tok; } $savetext = $text; $repcount++; } $text = $savetext; pop @item if $backtrack; unless (@item) { undef $_tok; last } $_tok = [@item]; last; } unless ($repcount >= 1) { Parse::RecDescent::_trace( q{<]>>}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched operator: []<< (return value: [} . qq{@{$_tok||[]}} . q{]}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; push @item, $item{'column_name(s)'} = $_tok || []; Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { event => 'update_on', fields => $item[3] }; }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/UPDATE/i /OF/i ]<<}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/INSERT/i, or /DELETE/i, or /UPDATE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{type}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{type}); %item = (__RULE__ => q{type}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_2_of_rule_type]}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_2_of_rule_type( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_2_of_rule_type]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_2_of_rule_type}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { event => $item[1] } }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/INSERT/i, or /DELETE/i, or /UPDATE/i]<<}, Parse::RecDescent::_tracefirst($text), q{type}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{type}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{type}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{type}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{type}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_12_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_12_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_12_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/COVARIANCE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_12_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_12_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/COVARIANCE/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:COVARIANCE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/COVARIANCE/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/COVAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_12_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_12_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/COVAR/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:COVAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/COVAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_12_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::scalar_fullselect { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"scalar_fullselect"}; Parse::RecDescent::_trace( q{Trying rule: [scalar_fullselect]}, Parse::RecDescent::_tracefirst($_[1]), q{scalar_fullselect}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['(' fullselect ')']}, Parse::RecDescent::_tracefirst($_[1]), q{scalar_fullselect}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{scalar_fullselect}); %item = (__RULE__ => q{scalar_fullselect}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{scalar_fullselect}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [fullselect]}, Parse::RecDescent::_tracefirst($text), q{scalar_fullselect}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{fullselect})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::fullselect( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{scalar_fullselect}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [fullselect]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{scalar_fullselect}, $tracelevel ) if defined $::RD_TRACE; $item{q{fullselect}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{scalar_fullselect}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['(' fullselect ')']<<}, Parse::RecDescent::_tracefirst($text), q{scalar_fullselect}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{scalar_fullselect}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{scalar_fullselect}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{scalar_fullselect}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{scalar_fullselect}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_options { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_options"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_options]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_options}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CASCADED/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_options}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_options}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_options}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CASCADED/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_options}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CASCADED)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CASCADED/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_options}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LOCAL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_options}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_options}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_options}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LOCAL/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_options}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LOCAL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LOCAL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_options}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_options}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_options}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_options}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_options}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::func_args { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"func_args"}; Parse::RecDescent::_trace( q{Trying rule: [func_args]}, Parse::RecDescent::_tracefirst($_[1]), q{func_args}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [expression]}, Parse::RecDescent::_tracefirst($_[1]), q{func_args}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{func_args}); %item = (__RULE__ => q{func_args}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{func_args}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{func_args}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{func_args}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [expression]<<}, Parse::RecDescent::_tracefirst($text), q{func_args}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{func_args}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{func_args}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{func_args}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{func_args}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::trigger_name { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"trigger_name"}; Parse::RecDescent::_trace( q{Trying rule: [trigger_name]}, Parse::RecDescent::_tracefirst($_[1]), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [SCHEMA '.' NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{trigger_name}); %item = (__RULE__ => q{trigger_name}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [SCHEMA]}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::SCHEMA( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [SCHEMA]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{SCHEMA}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: ['.']}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'.'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\.//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{NAME})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { schema => $item[1], name => $item[3] } }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [SCHEMA '.' NAME]<<}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{trigger_name}); %item = (__RULE__ => q{trigger_name}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { name => $item[1] } }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [NAME]<<}, Parse::RecDescent::_tracefirst($text), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{trigger_name}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{trigger_name}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{trigger_name}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{trigger_name}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule_numbering_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_2_of_production_1_of_rule_numbering_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_2_of_production_1_of_rule_numbering_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/RANGE\\s+BETWEEN\\s+UNBOUNDED\\s+PRECEDING\\s+AND\\s+UNBBOUNDED\\s+FOLLOWING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule_numbering_function}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule_numbering_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/RANGE\\s+BETWEEN\\s+UNBOUNDED\\s+PRECEDING\\s+AND\\s+UNBBOUNDED\\s+FOLLOWING/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:RANGE\s+BETWEEN\s+UNBOUNDED\s+PRECEDING\s+AND\s+UNBBOUNDED\s+FOLLOWING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/RANGE\\s+BETWEEN\\s+UNBOUNDED\\s+PRECEDING\\s+AND\\s+UNBBOUNDED\\s+FOLLOWING/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [window_aggregation_group_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule_numbering_function}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule_numbering_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [window_aggregation_group_clause]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::window_aggregation_group_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [window_aggregation_group_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{window_aggregation_group_clause}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [window_aggregation_group_clause]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_2_of_production_1_of_rule_numbering_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::method_name { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"method_name"}; Parse::RecDescent::_trace( q{Trying rule: [method_name]}, Parse::RecDescent::_tracefirst($_[1]), q{method_name}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{method_name}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{method_name}); %item = (__RULE__ => q{method_name}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{method_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{method_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{method_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{method_name}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { # must be a method of subject_expression }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [NAME]<<}, Parse::RecDescent::_tracefirst($text), q{method_name}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{method_name}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{method_name}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{method_name}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{method_name}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::quantified_p { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"quantified_p"}; Parse::RecDescent::_trace( q{Trying rule: [quantified_p]}, Parse::RecDescent::_tracefirst($_[1]), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [expression1 /(=|<>|<|>|<=|=>|\\^=|\\^<|\\^>|\\!=)/ /SOME|ANY|ALL/i '(' fullselect ')']}, Parse::RecDescent::_tracefirst($_[1]), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{quantified_p}); %item = (__RULE__ => q{quantified_p}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [expression1]}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression1( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression1]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression1}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/(=|<>|<|>|<=|=>|\\^=|\\^<|\\^>|\\!=)/]}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/(=|<>|<|>|<=|=>|\\^=|\\^<|\\^>|\\!=)/}) ->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:(=|<>|<|>|<=|=>|\^=|\^<|\^>|\!=))//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: [/SOME|ANY|ALL/i]}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/SOME|ANY|ALL/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SOME|ANY|ALL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'('})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [fullselect]}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{fullselect})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::fullselect( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [fullselect]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; $item{q{fullselect}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [expression1 /(=|<>|<|>|<=|=>|\\^=|\\^<|\\^>|\\!=)/ /SOME|ANY|ALL/i '(' fullselect ')']<<}, Parse::RecDescent::_tracefirst($text), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{quantified_p}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{quantified_p}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{quantified_p}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{quantified_p}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::common_table_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"common_table_expression"}; Parse::RecDescent::_trace( q{Trying rule: [common_table_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [table_name column_list /AS/i get_bracketed]}, Parse::RecDescent::_tracefirst($_[1]), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{common_table_expression}); %item = (__RULE__ => q{common_table_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [table_name]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::table_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [table_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{table_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [column_list]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{column_list})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_list( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [column_list]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{column_list}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/AS/i]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/AS/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:AS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [get_bracketed]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{get_bracketed})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::get_bracketed( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [get_bracketed]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{get_bracketed}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying action}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { name => $item{table_name}{name}, query => $item[4] }; }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [table_name column_list /AS/i get_bracketed]<<}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [table_name column_list /AS/i '(' fullselect ')']}, Parse::RecDescent::_tracefirst($_[1]), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{common_table_expression}); %item = (__RULE__ => q{common_table_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [table_name]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::table_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [table_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{table_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [column_list]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{column_list})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_list( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [column_list]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{column_list}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/AS/i]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/AS/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:AS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'('})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [fullselect]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{fullselect})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::fullselect( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [fullselect]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{fullselect}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [table_name column_list /AS/i '(' fullselect ')']<<}, Parse::RecDescent::_tracefirst($text), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{common_table_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{common_table_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{common_table_expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{common_table_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::after { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"after"}; Parse::RecDescent::_trace(q{Trying rule: [after]}, Parse::RecDescent::_tracefirst($_[1]), q{after}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/AFTER/i]}, Parse::RecDescent::_tracefirst($_[1]), q{after}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{after}); %item = (__RULE__ => q{after}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/AFTER/i]}, Parse::RecDescent::_tracefirst($text), q{after}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:AFTER)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/AFTER/i]<<}, Parse::RecDescent::_tracefirst($text), q{after}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{after}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{after}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{after}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{after}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::predicate { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"predicate"}; Parse::RecDescent::_trace( q{Trying rule: [predicate]}, Parse::RecDescent::_tracefirst($_[1]), q{predicate}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [basic_p]}, Parse::RecDescent::_tracefirst($_[1]), q{predicate}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{predicate}); %item = (__RULE__ => q{predicate}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [basic_p]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::basic_p( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [basic_p]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $item{q{basic_p}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [basic_p]<<}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [quantified_p]}, Parse::RecDescent::_tracefirst($_[1]), q{predicate}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{predicate}); %item = (__RULE__ => q{predicate}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [quantified_p]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::quantified_p( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [quantified_p]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $item{q{quantified_p}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [quantified_p]<<}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [between_p]}, Parse::RecDescent::_tracefirst($_[1]), q{predicate}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{predicate}); %item = (__RULE__ => q{predicate}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [between_p]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::between_p( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [between_p]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $item{q{between_p}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [between_p]<<}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [exists_p]}, Parse::RecDescent::_tracefirst($_[1]), q{predicate}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[3]; $text = $_[1]; my $_savetext; @item = (q{predicate}); %item = (__RULE__ => q{predicate}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [exists_p]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::exists_p( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [exists_p]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $item{q{exists_p}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [exists_p]<<}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [in_p]}, Parse::RecDescent::_tracefirst($_[1]), q{predicate}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[4]; $text = $_[1]; my $_savetext; @item = (q{predicate}); %item = (__RULE__ => q{predicate}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [in_p]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::in_p( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [in_p]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $item{q{in_p}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [in_p]<<}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [like_p]}, Parse::RecDescent::_tracefirst($_[1]), q{predicate}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[5]; $text = $_[1]; my $_savetext; @item = (q{predicate}); %item = (__RULE__ => q{predicate}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [like_p]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::like_p( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [like_p]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $item{q{like_p}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [like_p]<<}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [null_p]}, Parse::RecDescent::_tracefirst($_[1]), q{predicate}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[6]; $text = $_[1]; my $_savetext; @item = (q{predicate}); %item = (__RULE__ => q{predicate}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [null_p]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::null_p( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [null_p]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $item{q{null_p}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [null_p]<<}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [type_p]}, Parse::RecDescent::_tracefirst($_[1]), q{predicate}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[7]; $text = $_[1]; my $_savetext; @item = (q{predicate}); %item = (__RULE__ => q{predicate}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [type_p]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::type_p( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [type_p]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $item{q{type_p}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [type_p]<<}, Parse::RecDescent::_tracefirst($text), q{predicate}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{predicate}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{predicate}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{predicate}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{predicate}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_name { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"column_name"}; Parse::RecDescent::_trace( q{Trying rule: [column_name]}, Parse::RecDescent::_tracefirst($_[1]), q{column_name}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{column_name}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{column_name}); %item = (__RULE__ => q{column_name}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{column_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{column_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{column_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [NAME]<<}, Parse::RecDescent::_tracefirst($text), q{column_name}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{column_name}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{column_name}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{column_name}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{column_name}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::method_invocation { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"method_invocation"}; Parse::RecDescent::_trace( q{Trying rule: [method_invocation]}, Parse::RecDescent::_tracefirst($_[1]), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [subject_expression '..' method_name '(']}, Parse::RecDescent::_tracefirst($_[1]), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{method_invocation}); %item = (__RULE__ => q{method_invocation}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [subject_expression]}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::subject_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [subject_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; $item{q{subject_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: ['..']}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'..'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\.\.//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [method_name]}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{method_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::method_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [method_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; $item{q{method_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: ['(']}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{'('})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_method_invocation, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule_method_invocation]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_method_invocation(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [subject_expression '..' method_name '(']<<}, Parse::RecDescent::_tracefirst($text), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{method_invocation}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{method_invocation}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{method_invocation}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{method_invocation}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_dereference_operation { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_dereference_operation"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_dereference_operation]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['(' expression ')']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_dereference_operation}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_dereference_operation}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying repeated subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{expression})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression, 1, 100000000, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [expression]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression(s)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['(' expression ')']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_dereference_operation}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_searched_when_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_searched_when_clause"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_searched_when_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/WHEN/i search_condition /THEN/i result_expression, or /NULL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_searched_when_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_searched_when_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/WHEN/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:WHEN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [search_condition]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{search_condition})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::search_condition( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [search_condition]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{search_condition}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/THEN/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/THEN/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:THEN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{result_expression, or /NULL/i})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/WHEN/i search_condition /THEN/i result_expression, or /NULL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::group_bound2 { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"group_bound2"}; Parse::RecDescent::_trace( q{Trying rule: [group_bound2]}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/UNBOUNDED\\s+PRECEDING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{group_bound2}); %item = (__RULE__ => q{group_bound2}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/UNBOUNDED\\s+PRECEDING/i]}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:UNBOUNDED\s+PRECEDING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/UNBOUNDED\\s+PRECEDING/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [unsigned_constant /PRECEDING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{group_bound2}); %item = (__RULE__ => q{group_bound2}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [unsigned_constant]}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::unsigned_constant( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [unsigned_constant]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $item{q{unsigned_constant}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/PRECEDING/i]}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/PRECEDING/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:PRECEDING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [unsigned_constant /PRECEDING/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [unsigned_constant /FOLLOWING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{group_bound2}); %item = (__RULE__ => q{group_bound2}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [unsigned_constant]}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::unsigned_constant( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [unsigned_constant]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $item{q{unsigned_constant}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/FOLLOWING/i]}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/FOLLOWING/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:FOLLOWING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [unsigned_constant /FOLLOWING/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CURRENT\\s+ROW/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[3]; $text = $_[1]; my $_savetext; @item = (q{group_bound2}); %item = (__RULE__ => q{group_bound2}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CURRENT\\s+ROW/i]}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CURRENT\s+ROW)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CURRENT\\s+ROW/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{group_bound2}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{group_bound2}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{group_bound2}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{group_bound2}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::searched_when_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"searched_when_clause"}; Parse::RecDescent::_trace( q{Trying rule: [searched_when_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/WHEN/i]}, Parse::RecDescent::_tracefirst($_[1]), q{searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{searched_when_clause}); %item = (__RULE__ => q{searched_when_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying repeated subrule: [/WHEN/i]}, Parse::RecDescent::_tracefirst($text), q{searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_searched_when_clause, 1, 100000000, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule_searched_when_clause]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_searched_when_clause(s)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/WHEN/i]<<}, Parse::RecDescent::_tracefirst($text), q{searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{searched_when_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{searched_when_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{searched_when_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::basic_p { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"basic_p"}; Parse::RecDescent::_trace(q{Trying rule: [basic_p]}, Parse::RecDescent::_tracefirst($_[1]), q{basic_p}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [expression /(=|<>|<|>|<=|=>|\\^=|\\^<|\\^>|\\!=)/ expression]}, Parse::RecDescent::_tracefirst($_[1]), q{basic_p}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{basic_p}); %item = (__RULE__ => q{basic_p}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{basic_p}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{basic_p}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{basic_p}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/(=|<>|<|>|<=|=>|\\^=|\\^<|\\^>|\\!=)/]}, Parse::RecDescent::_tracefirst($text), q{basic_p}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/(=|<>|<|>|<=|=>|\\^=|\\^<|\\^>|\\!=)/}) ->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:(=|<>|<|>|<=|=>|\^=|\^<|\^>|\!=))//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{basic_p}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{basic_p}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{basic_p}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [expression /(=|<>|<|>|<=|=>|\\^=|\\^<|\\^>|\\!=)/ expression]<<}, Parse::RecDescent::_tracefirst($text), q{basic_p}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{basic_p}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{basic_p}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{basic_p}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{basic_p}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::asc_option { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"asc_option"}; Parse::RecDescent::_trace( q{Trying rule: [asc_option]}, Parse::RecDescent::_tracefirst($_[1]), q{asc_option}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ASC/i /NULLS\\s+FIRST/i, or /NULLS\\s+LAST/i]}, Parse::RecDescent::_tracefirst($_[1]), q{asc_option}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{asc_option}); %item = (__RULE__ => q{asc_option}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ASC/i]}, Parse::RecDescent::_tracefirst($text), q{asc_option}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ASC)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying repeated subrule: [/NULLS\\s+FIRST/i, or /NULLS\\s+LAST/i]}, Parse::RecDescent::_tracefirst($text), q{asc_option}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{/NULLS\\s+FIRST/i, or /NULLS\\s+LAST/i}) ->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_asc_option, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{asc_option}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule_asc_option]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{asc_option}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_asc_option(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/ASC/i /NULLS\\s+FIRST/i, or /NULLS\\s+LAST/i]<<}, Parse::RecDescent::_tracefirst($text), q{asc_option}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{asc_option}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{asc_option}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{asc_option}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{asc_option}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::search_condition { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"search_condition"}; Parse::RecDescent::_trace( q{Trying rule: [search_condition]}, Parse::RecDescent::_tracefirst($_[1]), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/[^)]+/]}, Parse::RecDescent::_tracefirst($_[1]), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{search_condition}); %item = (__RULE__ => q{search_condition}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/[^)]+/]}, Parse::RecDescent::_tracefirst($text), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:[^)]+)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/[^)]+/]<<}, Parse::RecDescent::_tracefirst($text), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NOT|/i predicate, or '(' cond]}, Parse::RecDescent::_tracefirst($_[1]), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{search_condition}); %item = (__RULE__ => q{search_condition}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NOT|/i]}, Parse::RecDescent::_tracefirst($text), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NOT|)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_2_of_rule_search_condition]}, Parse::RecDescent::_tracefirst($text), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{predicate, or '('})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_2_of_rule_search_condition( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_2_of_rule_search_condition]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_2_of_rule_search_condition}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [cond]}, Parse::RecDescent::_tracefirst($text), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{cond})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::cond, 0, 100000000, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [cond]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; $item{q{cond(s?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/NOT|/i predicate, or '(' cond]<<}, Parse::RecDescent::_tracefirst($text), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{search_condition}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{search_condition}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{search_condition}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{search_condition}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_operator { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_operator"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_operator]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CONCAT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_operator}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_operator}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CONCAT/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CONCAT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CONCAT/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['||']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_operator}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_operator}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['||']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\|\|//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['||']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_operator}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::simple_when_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"simple_when_clause"}; Parse::RecDescent::_trace( q{Trying rule: [simple_when_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [expression /WHEN/i]}, Parse::RecDescent::_tracefirst($_[1]), q{simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{simple_when_clause}); %item = (__RULE__ => q{simple_when_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [/WHEN/i]}, Parse::RecDescent::_tracefirst($text), q{simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{/WHEN/i})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_simple_when_clause, 1, 100000000, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule_simple_when_clause]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_simple_when_clause(s)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [expression /WHEN/i]<<}, Parse::RecDescent::_tracefirst($text), q{simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{simple_when_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{simple_when_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{simple_when_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::INNER { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"INNER"}; Parse::RecDescent::_trace(q{Trying rule: [INNER]}, Parse::RecDescent::_tracefirst($_[1]), q{INNER}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/inner/i]}, Parse::RecDescent::_tracefirst($_[1]), q{INNER}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{INNER}); %item = (__RULE__ => q{INNER}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/inner/i]}, Parse::RecDescent::_tracefirst($text), q{INNER}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:inner)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/inner/i]<<}, Parse::RecDescent::_tracefirst($text), q{INNER}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{INNER}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{INNER}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{INNER}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{INNER}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::eofile { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"eofile"}; Parse::RecDescent::_trace(q{Trying rule: [eofile]}, Parse::RecDescent::_tracefirst($_[1]), q{eofile}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/^\\Z/]}, Parse::RecDescent::_tracefirst($_[1]), q{eofile}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{eofile}); %item = (__RULE__ => q{eofile}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/^\\Z/]}, Parse::RecDescent::_tracefirst($text), q{eofile}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:^\Z)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/^\\Z/]<<}, Parse::RecDescent::_tracefirst($text), q{eofile}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{eofile}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{eofile}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{eofile}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{eofile}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::cond { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"cond"}; Parse::RecDescent::_trace(q{Trying rule: [cond]}, Parse::RecDescent::_tracefirst($_[1]), q{cond}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/AND/i, or /OR/i /NOT|/i predicate, or '(']}, Parse::RecDescent::_tracefirst($_[1]), q{cond}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{cond}); %item = (__RULE__ => q{cond}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_cond]}, Parse::RecDescent::_tracefirst($text), q{cond}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_cond( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{cond}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_cond]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{cond}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_cond}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/NOT|/i]}, Parse::RecDescent::_tracefirst($text), q{cond}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/NOT|/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NOT|)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_2_of_production_1_of_rule_cond]}, Parse::RecDescent::_tracefirst($text), q{cond}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{predicate, or '('})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule_cond( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{cond}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_2_of_production_1_of_rule_cond]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{cond}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_2_of_production_1_of_rule_cond}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/AND/i, or /OR/i /NOT|/i predicate, or '(']<<}, Parse::RecDescent::_tracefirst($text), q{cond}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{cond}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{cond}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{cond}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{cond}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::ld_type { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"ld_type"}; Parse::RecDescent::_trace(q{Trying rule: [ld_type]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_type}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [function]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{ld_type}); %item = (__RULE__ => q{ld_type}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [function]}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $item{q{function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [function]<<}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['(' expression ')']}, Parse::RecDescent::_tracefirst($_[1]), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{ld_type}); %item = (__RULE__ => q{ld_type}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['(' expression ')']<<}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [constant]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{ld_type}); %item = (__RULE__ => q{ld_type}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [constant]}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::constant( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [constant]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $item{q{constant}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [constant]<<}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [column_name]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[3]; $text = $_[1]; my $_savetext; @item = (q{ld_type}); %item = (__RULE__ => q{ld_type}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [column_name]}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [column_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $item{q{column_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [column_name]<<}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [host_variable]}, Parse::RecDescent::_tracefirst($_[1]), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[4]; $text = $_[1]; my $_savetext; @item = (q{ld_type}); %item = (__RULE__ => q{ld_type}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [host_variable]}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::host_variable( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [host_variable]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $item{q{host_variable}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [host_variable]<<}, Parse::RecDescent::_tracefirst($text), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{ld_type}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{ld_type}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{ld_type}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{ld_type}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::RIGHT { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"RIGHT"}; Parse::RecDescent::_trace(q{Trying rule: [RIGHT]}, Parse::RecDescent::_tracefirst($_[1]), q{RIGHT}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/right/i]}, Parse::RecDescent::_tracefirst($_[1]), q{RIGHT}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{RIGHT}); %item = (__RULE__ => q{RIGHT}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/right/i]}, Parse::RecDescent::_tracefirst($text), q{RIGHT}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:right)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/right/i]<<}, Parse::RecDescent::_tracefirst($text), q{RIGHT}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{RIGHT}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{RIGHT}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{RIGHT}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{RIGHT}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_method_invocation { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_method_invocation"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_method_invocation]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['(' expression ')']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_method_invocation}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_method_invocation}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying repeated subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{expression})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression, 1, 100000000, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [expression]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression(s)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['(' expression ')']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_method_invocation}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::LEFT { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"LEFT"}; Parse::RecDescent::_trace(q{Trying rule: [LEFT]}, Parse::RecDescent::_tracefirst($_[1]), q{LEFT}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/left/i]}, Parse::RecDescent::_tracefirst($_[1]), q{LEFT}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{LEFT}); %item = (__RULE__ => q{LEFT}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/left/i]}, Parse::RecDescent::_tracefirst($text), q{LEFT}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:left)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/left/i]<<}, Parse::RecDescent::_tracefirst($text), q{LEFT}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{LEFT}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{LEFT}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{LEFT}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{LEFT}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::table_name { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"table_name"}; Parse::RecDescent::_trace( q{Trying rule: [table_name]}, Parse::RecDescent::_tracefirst($_[1]), q{table_name}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [SCHEMA '.' NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{table_name}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{table_name}); %item = (__RULE__ => q{table_name}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [SCHEMA]}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::SCHEMA( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [SCHEMA]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{SCHEMA}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: ['.']}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'.'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\.//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{NAME})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { schema => $item[1], name => $item[3] } }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [SCHEMA '.' NAME]<<}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{table_name}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{table_name}); %item = (__RULE__ => q{table_name}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { name => $item[1] } }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [NAME]<<}, Parse::RecDescent::_tracefirst($text), q{table_name}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{table_name}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{table_name}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{table_name}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{table_name}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_53_of_rule_sysfun { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_53_of_rule_sysfun"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_53_of_rule_sysfun]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TRUNCATE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_53_of_rule_sysfun}); %item = (__RULE__ => q{_alternation_1_of_production_53_of_rule_sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TRUNCATE/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TRUNCATE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TRUNCATE/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TRUNC/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_53_of_rule_sysfun}); %item = (__RULE__ => q{_alternation_1_of_production_53_of_rule_sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TRUNC/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TRUNC)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TRUNC/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_53_of_rule_sysfun}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::options { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"options"}; Parse::RecDescent::_trace(q{Trying rule: [options]}, Parse::RecDescent::_tracefirst($_[1]), q{options}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/WITH/i /CASCADED/i, or /LOCAL/i /CHECK\\s+OPTION/i]}, Parse::RecDescent::_tracefirst($_[1]), q{options}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{options}); %item = (__RULE__ => q{options}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/WITH/i]}, Parse::RecDescent::_tracefirst($text), q{options}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:WITH)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_options]}, Parse::RecDescent::_tracefirst($text), q{options}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{/CASCADED/i, or /LOCAL/i})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_options( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{options}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_options]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{options}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_options}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/CHECK\\s+OPTION/i]}, Parse::RecDescent::_tracefirst($text), q{options}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/CHECK\\s+OPTION/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CHECK\s+OPTION)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/WITH/i /CASCADED/i, or /LOCAL/i /CHECK\\s+OPTION/i]<<}, Parse::RecDescent::_tracefirst($text), q{options}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{options}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{options}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{options}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{options}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"function"}; Parse::RecDescent::_trace( q{Trying rule: [function]}, Parse::RecDescent::_tracefirst($_[1]), q{function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SYSIBM\\.|/i, or /SYSFUN\\.|/i, or userdefined_function '(' ')']}, Parse::RecDescent::_tracefirst($_[1]), q{function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{function}); %item = (__RULE__ => q{function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_function]}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'('})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying operator: []}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{})->at($text); $_tok = undef; OPLOOP: while (1) { $repcount = 0; my @item; # MATCH LEFTARG Parse::RecDescent::_trace( q{Trying subrule: [func_args]}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{func_args})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::func_args( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [func_args]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $item{q{func_args}} = $_tok; push @item, $_tok; } $repcount++; my $savetext = $text; my $backtrack; # MATCH (OP RIGHTARG)(s) while ($repcount < 100000000) { $backtrack = 0; Parse::RecDescent::_trace( q{Trying terminal: [/,/]}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/,/})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:,)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; pop @item; if (defined $1) { push @item, $item{'func_args(s)'} = $1; $backtrack = 1; } Parse::RecDescent::_trace( q{Trying subrule: [func_args]}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{func_args})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::func_args( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [func_args]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $item{q{func_args}} = $_tok; push @item, $_tok; } $savetext = $text; $repcount++; } $text = $savetext; pop @item if $backtrack; unless (@item) { undef $_tok; last } $_tok = [@item]; last; } unless ($repcount >= 1) { Parse::RecDescent::_trace( q{<]>>}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched operator: []<< (return value: [} . qq{@{$_tok||[]}} . q{]}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; push @item, $item{'func_args(s)'} = $_tok || []; Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SYSIBM\\.|/i, or /SYSFUN\\.|/i, or userdefined_function '(' ')']<<}, Parse::RecDescent::_tracefirst($text), q{function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{function}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_41_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_41_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_41_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/INTEGER/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_41_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_41_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/INTEGER/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:INTEGER)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/INTEGER/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/INT/]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_41_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_41_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/INT/]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:INT)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/INT/]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_41_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_case_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_case_expression"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_case_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [searched_when_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_case_expression}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_case_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [searched_when_clause]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::searched_when_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [searched_when_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{searched_when_clause}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [searched_when_clause]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [simple_when_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_case_expression}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_case_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [simple_when_clause]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::simple_when_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [simple_when_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{simple_when_clause}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [simple_when_clause]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_case_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_window_order_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_window_order_clause"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_window_order_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [sort_key_expression asc_option, or desc_option]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_window_order_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_window_order_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [sort_key_expression]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::sort_key_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [sort_key_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{sort_key_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [asc_option, or desc_option]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{asc_option, or desc_option})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [sort_key_expression asc_option, or desc_option]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_window_order_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::create { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"create"}; Parse::RecDescent::_trace(q{Trying rule: [create]}, Parse::RecDescent::_tracefirst($_[1]), q{create}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [CREATE TRIGGER trigger_name before type /ON/i table_name reference_b /FOR EACH ROW/i 'MODE DB2SQL' triggered_action]}, Parse::RecDescent::_tracefirst($_[1]), q{create}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{create}); %item = (__RULE__ => q{create}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [CREATE]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::CREATE( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [CREATE]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{CREATE}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [TRIGGER]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{TRIGGER})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::TRIGGER( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [TRIGGER]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{TRIGGER}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [trigger_name]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{trigger_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::trigger_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [trigger_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{trigger_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [before]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{before})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::before( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [before]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{before}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [type]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{type})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::type( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [type]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{type}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/ON/i]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/ON/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ON)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [table_name]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{table_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::table_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [table_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{table_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [reference_b]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{reference_b})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::reference_b, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [reference_b]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{reference_b(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying terminal: [/FOR EACH ROW/i]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/FOR EACH ROW/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:FOR EACH ROW)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['MODE DB2SQL']}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'MODE DB2SQL'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\AMODE\ DB2SQL//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [triggered_action]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{triggered_action})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::triggered_action( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [triggered_action]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{triggered_action}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { my $table_name = $item{'table_name'}{'name'}; $return = { table => $table_name, schema => $item{'trigger_name'}{'schema'}, name => $item{'trigger_name'}{'name'}, when => 'before', db_event => $item{'type'}->{'event'}, fields => $item{'type'}{'fields'}, condition => $item{'triggered_action'}{'condition'}, reference => $item{'reference_b'}, granularity => $item[9], action => $item{'triggered_action'}{'statement'} }; push @triggers, $return; }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [CREATE TRIGGER trigger_name before type /ON/i table_name reference_b /FOR EACH ROW/i 'MODE DB2SQL' triggered_action]<<}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [CREATE TRIGGER trigger_name after type /ON/i table_name reference_a /FOR EACH ROW|FOR EACH STATEMENT/i 'MODE DB2SQL' triggered_action]}, Parse::RecDescent::_tracefirst($_[1]), q{create}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{create}); %item = (__RULE__ => q{create}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [CREATE]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::CREATE( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [CREATE]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{CREATE}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [TRIGGER]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{TRIGGER})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::TRIGGER( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [TRIGGER]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{TRIGGER}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [trigger_name]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{trigger_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::trigger_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [trigger_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{trigger_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [after]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{after})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::after( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [after]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{after}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [type]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{type})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::type( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [type]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{type}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/ON/i]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/ON/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ON)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [table_name]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{table_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::table_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [table_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{table_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [reference_a]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{reference_a})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::reference_a, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [reference_a]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{reference_a(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying terminal: [/FOR EACH ROW|FOR EACH STATEMENT/i]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/FOR EACH ROW|FOR EACH STATEMENT/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:FOR EACH ROW|FOR EACH STATEMENT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['MODE DB2SQL']}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'MODE DB2SQL'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\AMODE\ DB2SQL//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [triggered_action]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{triggered_action})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::triggered_action( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [triggered_action]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{triggered_action}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { my $table_name = $item{'table_name'}{'name'}; $return = { table => $table_name, schema => $item{'trigger_name'}{'schema'}, name => $item{'trigger_name'}{'name'}, when => 'after', db_event => $item{'type'}{'event'}, fields => $item{'type'}{'fields'}, condition => $item{'triggered_action'}{'condition'}, reference => $item{'reference_a'}, granularity => $item[9], action => $item{'triggered_action'}{'statement'} }; push @triggers, $return; }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [CREATE TRIGGER trigger_name after type /ON/i table_name reference_a /FOR EACH ROW|FOR EACH STATEMENT/i 'MODE DB2SQL' triggered_action]<<}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [CREATE /FEDERATED|/i VIEW view_name column_list /AS/i with_expression SQL_procedure_statement]}, Parse::RecDescent::_tracefirst($_[1]), q{create}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{create}); %item = (__RULE__ => q{create}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [CREATE]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::CREATE( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [CREATE]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{CREATE}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/FEDERATED|/i]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/FEDERATED|/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:FEDERATED|)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [VIEW]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{VIEW})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::VIEW( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [VIEW]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{VIEW}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [view_name]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{view_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::view_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [view_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{view_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [column_list]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{column_list})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_list, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [column_list]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{column_list(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying terminal: [/AS/i]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/AS/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:AS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying repeated subrule: [with_expression]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{with_expression})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::with_expression, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [with_expression]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{with_expression(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying subrule: [SQL_procedure_statement]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{SQL_procedure_statement})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::SQL_procedure_statement( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [SQL_procedure_statement]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $item{q{SQL_procedure_statement}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { name => $item{view_name}{name}, sql => $item{SQL_procedure_statement}, with => $item{'with_expression(?)'}, fields => $item{'column_list(?)'} }; push @views, $return; }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [CREATE /FEDERATED|/i VIEW view_name column_list /AS/i with_expression SQL_procedure_statement]<<}, Parse::RecDescent::_tracefirst($text), q{create}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{create}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{create}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{create}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{create}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::sysfun { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"sysfun"}; Parse::RecDescent::_trace(q{Trying rule: [sysfun]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ABS/i, or /ABSVAL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_sysfun]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_sysfun( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_sysfun]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_sysfun}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/ABS/i, or /ABSVAL/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ACOS/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ACOS/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ACOS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ACOS/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ASCII/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ASCII/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ASCII)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ASCII/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ASIN/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[3]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ASIN/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ASIN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ASIN/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ATAN/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[4]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ATAN/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ATAN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ATAN/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ATAN2/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[5]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ATAN2/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ATAN2)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ATAN2/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CEIL/i, or /CEILING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[6]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_7_of_rule_sysfun]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_7_of_rule_sysfun( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_7_of_rule_sysfun]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_7_of_rule_sysfun}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/CEIL/i, or /CEILING/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CHAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[7]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CHAR/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CHAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CHAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CHR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[8]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CHR/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CHR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CHR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/COS/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[9]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/COS/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:COS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/COS/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/COT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[10]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/COT/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:COT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/COT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DAYNAME/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[11]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DAYNAME/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DAYNAME)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DAYNAME/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DAYOFWEEK/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[12]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DAYOFWEEK/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DAYOFWEEK)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DAYOFWEEK/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DAYOFWEEK_ISO/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[13]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DAYOFWEEK_ISO/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DAYOFWEEK_ISO)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DAYOFWEEK_ISO/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DAYOFYEAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[14]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DAYOFYEAR/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DAYOFYEAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DAYOFYEAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DEGREES/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[15]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DEGREES/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DEGREES)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DEGREES/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DIFFERENCE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[16]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DIFFERENCE/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DIFFERENCE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DIFFERENCE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DOUBLE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[17]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DOUBLE/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DOUBLE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DOUBLE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/EXP/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[18]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/EXP/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:EXP)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/EXP/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/FLOOR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[19]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/FLOOR/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:FLOOR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/FLOOR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/GET_ROUTINE_SAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[20]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/GET_ROUTINE_SAR/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:GET_ROUTINE_SAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/GET_ROUTINE_SAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/INSERT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[21]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/INSERT/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:INSERT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/INSERT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/JULIAN_DAY/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[22]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/JULIAN_DAY/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:JULIAN_DAY)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/JULIAN_DAY/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LCASE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[23]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LCASE/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LCASE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LCASE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LEFT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[24]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LEFT/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LEFT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LEFT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LN/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[25]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LN/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LN/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LOCATE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[26]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LOCATE/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LOCATE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LOCATE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LOG/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[27]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LOG/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LOG)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LOG/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LOG10/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[28]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LOG10/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LOG10)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LOG10/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LTRIM/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[29]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LTRIM/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LTRIM)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LTRIM/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MIDNIGHT_SECONDS/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[30]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MIDNIGHT_SECONDS/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MIDNIGHT_SECONDS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MIDNIGHT_SECONDS/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MOD/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[31]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MOD/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MOD)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MOD/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/MONTHNAME/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[32]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/MONTHNAME/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:MONTHNAME)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/MONTHNAME/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/POWER/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[33]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/POWER/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:POWER)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/POWER/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/PUT_ROUTINE_SAR/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[34]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/PUT_ROUTINE_SAR/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:PUT_ROUTINE_SAR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/PUT_ROUTINE_SAR/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/QUARTER/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[35]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/QUARTER/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:QUARTER)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/QUARTER/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/RADIANS/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[36]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/RADIANS/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:RADIANS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/RADIANS/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/RAND/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[37]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/RAND/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:RAND)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/RAND/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REPEAT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[38]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REPEAT/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REPEAT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REPEAT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REPLACE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[39]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REPLACE/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REPLACE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REPLACE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/RIGHT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[40]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/RIGHT/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:RIGHT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/RIGHT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ROUND/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[41]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ROUND/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ROUND)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ROUND/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/RTRIM/ I]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[42]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/RTRIM/]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:RTRIM)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace(q{Trying subrule: [I]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{I})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::I( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [I]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $item{q{I}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/RTRIM/ I]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SIGN/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[43]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SIGN/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SIGN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SIGN/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SIN/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[44]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SIN/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SIN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SIN/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SOUNDEX/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[45]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SOUNDEX/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SOUNDEX)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SOUNDEX/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SPACE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[46]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SPACE/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SPACE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SPACE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SQLCACHE_SNAPSHOT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[47]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SQLCACHE_SNAPSHOT/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SQLCACHE_SNAPSHOT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SQLCACHE_SNAPSHOT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SQRT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[48]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SQRT/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SQRT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/SQRT/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TAN/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[49]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TAN/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TAN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TAN/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TIMESTAMP_ISO/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[50]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TIMESTAMP_ISO/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TIMESTAMP_ISO)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TIMESTAMP_ISO/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TIMESTAMPDIFF/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[51]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TIMESTAMPDIFF/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TIMESTAMPDIFF)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TIMESTAMPDIFF/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TRUNCATE/i, or /TRUNC/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[52]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_53_of_rule_sysfun]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_53_of_rule_sysfun( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_53_of_rule_sysfun]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_53_of_rule_sysfun}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/TRUNCATE/i, or /TRUNC/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/UCASE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[53]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/UCASE/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:UCASE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/UCASE/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/WEEK/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[54]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/WEEK/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:WEEK)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/WEEK/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/WEEK_ISO/i]}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[55]; $text = $_[1]; my $_savetext; @item = (q{sysfun}); %item = (__RULE__ => q{sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/WEEK_ISO/i]}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:WEEK_ISO)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/WEEK_ISO/i]<<}, Parse::RecDescent::_tracefirst($text), q{sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{sysfun}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{sysfun}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{sysfun}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{sysfun}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SELECTIVITY/i numeric_constant]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SELECTIVITY/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SELECTIVITY)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [numeric_constant]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{numeric_constant})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::numeric_constant( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [numeric_constant]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $item{q{numeric_constant}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/SELECTIVITY/i numeric_constant]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"NAME"}; Parse::RecDescent::_trace(q{Trying rule: [NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{NAME}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/\\w+/]}, Parse::RecDescent::_tracefirst($_[1]), q{NAME}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{NAME}); %item = (__RULE__ => q{NAME}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/\\w+/]}, Parse::RecDescent::_tracefirst($text), q{NAME}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:\w+)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/\\w+/]<<}, Parse::RecDescent::_tracefirst($text), q{NAME}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/\\w\{1,18\}/]}, Parse::RecDescent::_tracefirst($_[1]), q{NAME}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{NAME}); %item = (__RULE__ => q{NAME}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/\\w\{1,18\}/]}, Parse::RecDescent::_tracefirst($text), q{NAME}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:\w{1,18})//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/\\w\{1,18\}/]<<}, Parse::RecDescent::_tracefirst($text), q{NAME}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{NAME}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{NAME}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{NAME}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{NAME}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::constant { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"constant"}; Parse::RecDescent::_trace( q{Trying rule: [constant]}, Parse::RecDescent::_tracefirst($_[1]), q{constant}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [int_const]}, Parse::RecDescent::_tracefirst($_[1]), q{constant}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{constant}); %item = (__RULE__ => q{constant}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [int_const]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::int_const( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [int_const]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $item{q{int_const}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [int_const]<<}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [float_const]}, Parse::RecDescent::_tracefirst($_[1]), q{constant}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{constant}); %item = (__RULE__ => q{constant}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [float_const]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::float_const( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [float_const]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $item{q{float_const}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [float_const]<<}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [dec_const]}, Parse::RecDescent::_tracefirst($_[1]), q{constant}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{constant}); %item = (__RULE__ => q{constant}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [dec_const]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::dec_const( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [dec_const]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $item{q{dec_const}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [dec_const]<<}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [char_const]}, Parse::RecDescent::_tracefirst($_[1]), q{constant}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[3]; $text = $_[1]; my $_savetext; @item = (q{constant}); %item = (__RULE__ => q{constant}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [char_const]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::char_const( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [char_const]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $item{q{char_const}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [char_const]<<}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [hex_const]}, Parse::RecDescent::_tracefirst($_[1]), q{constant}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[4]; $text = $_[1]; my $_savetext; @item = (q{constant}); %item = (__RULE__ => q{constant}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [hex_const]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::hex_const( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [hex_const]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $item{q{hex_const}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [hex_const]<<}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [grastr_const]}, Parse::RecDescent::_tracefirst($_[1]), q{constant}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[5]; $text = $_[1]; my $_savetext; @item = (q{constant}); %item = (__RULE__ => q{constant}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [grastr_const]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::grastr_const( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [grastr_const]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $item{q{grastr_const}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [grastr_const]<<}, Parse::RecDescent::_tracefirst($text), q{constant}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{constant}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{constant}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{constant}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{constant}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_ranking_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_ranking_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_ranking_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/RANK/ '()']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_ranking_function}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_ranking_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/RANK/]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:RANK)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['()']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'()'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/RANK/ '()']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DENSE_RANK|DENSERANK/i '()']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_ranking_function}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_ranking_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DENSE_RANK|DENSERANK/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DENSE_RANK|DENSERANK)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['()']}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'()'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/DENSE_RANK|DENSERANK/i '()']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_ranking_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::window_aggregation_group_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"window_aggregation_group_clause"}; Parse::RecDescent::_trace( q{Trying rule: [window_aggregation_group_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ROWS/i, or /RANGE/i group_start, or group_between, or group_end]}, Parse::RecDescent::_tracefirst($_[1]), q{window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{window_aggregation_group_clause}); %item = (__RULE__ => q{window_aggregation_group_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_window_aggregation_group_clause]}, Parse::RecDescent::_tracefirst($text), q{window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_window_aggregation_group_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_window_aggregation_group_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_window_aggregation_group_clause}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [_alternation_2_of_production_1_of_rule_window_aggregation_group_clause]}, Parse::RecDescent::_tracefirst($text), q{window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{group_start, or group_between, or group_end}) ->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule_window_aggregation_group_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_2_of_production_1_of_rule_window_aggregation_group_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/ROWS/i, or /RANGE/i group_start, or group_between, or group_end]<<}, Parse::RecDescent::_tracefirst($text), q{window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{window_aggregation_group_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{window_aggregation_group_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{window_aggregation_group_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule_window_aggregation_group_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_2_of_production_1_of_rule_window_aggregation_group_clause"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_2_of_production_1_of_rule_window_aggregation_group_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [group_start]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [group_start]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::group_start( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [group_start]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{group_start}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [group_start]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [group_between]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [group_between]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::group_between( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [group_between]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{group_between}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [group_between]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [group_end]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [group_end]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::group_end( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [group_end]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{group_end}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [group_end]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_2_of_production_1_of_rule_window_aggregation_group_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::VIEW { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"VIEW"}; Parse::RecDescent::_trace(q{Trying rule: [VIEW]}, Parse::RecDescent::_tracefirst($_[1]), q{VIEW}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/view/i]}, Parse::RecDescent::_tracefirst($_[1]), q{VIEW}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{VIEW}); %item = (__RULE__ => q{VIEW}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/view/i]}, Parse::RecDescent::_tracefirst($text), q{VIEW}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:view)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/view/i]<<}, Parse::RecDescent::_tracefirst($text), q{VIEW}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{VIEW}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{VIEW}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{VIEW}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{VIEW}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::with_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"with_expression"}; Parse::RecDescent::_trace( q{Trying rule: [with_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/WITH/i ]}, Parse::RecDescent::_tracefirst($_[1]), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{with_expression}); %item = (__RULE__ => q{with_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/WITH/i]}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:WITH)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying operator: []}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->is( q{} )->at($text); $_tok = undef; OPLOOP: while (1) { $repcount = 0; my @item; # MATCH LEFTARG Parse::RecDescent::_trace( q{Trying subrule: [common_table_expression]}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{common_table_expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::common_table_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [common_table_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{common_table_expression}} = $_tok; push @item, $_tok; } $repcount++; my $savetext = $text; my $backtrack; # MATCH (OP RIGHTARG)(s) while ($repcount < 100000000) { $backtrack = 0; Parse::RecDescent::_trace( q{Trying terminal: [/,/]}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/,/})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:,)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; pop @item; if (defined $1) { push @item, $item{'common_table_expression(s)'} = $1; $backtrack = 1; } Parse::RecDescent::_trace( q{Trying subrule: [common_table_expression]}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{common_table_expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::common_table_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [common_table_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{common_table_expression}} = $_tok; push @item, $_tok; } $savetext = $text; $repcount++; } $text = $savetext; pop @item if $backtrack; unless (@item) { undef $_tok; last } $_tok = [@item]; last; } unless ($repcount >= 1) { Parse::RecDescent::_trace( q{<]>>}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched operator: []<< (return value: [} . qq{@{$_tok||[]}} . q{]}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; push @item, $item{'common_table_expression(s)'} = $_tok || []; Parse::RecDescent::_trace( q{Trying action}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = $item{'common_table_expression'}; }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/WITH/i ]<<}, Parse::RecDescent::_tracefirst($text), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{with_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{with_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{with_expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{with_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::numeric_constant { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"numeric_constant"}; Parse::RecDescent::_trace( q{Trying rule: [numeric_constant]}, Parse::RecDescent::_tracefirst($_[1]), q{numeric_constant}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/\\d+/]}, Parse::RecDescent::_tracefirst($_[1]), q{numeric_constant}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{numeric_constant}); %item = (__RULE__ => q{numeric_constant}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/\\d+/]}, Parse::RecDescent::_tracefirst($text), q{numeric_constant}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:\d+)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/\\d+/]<<}, Parse::RecDescent::_tracefirst($text), q{numeric_constant}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{numeric_constant}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{numeric_constant}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{numeric_constant}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{numeric_constant}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::old_new_table { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"old_new_table"}; Parse::RecDescent::_trace( q{Trying rule: [old_new_table]}, Parse::RecDescent::_tracefirst($_[1]), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/OLD_TABLE/i /(AS)?/i identifier]}, Parse::RecDescent::_tracefirst($_[1]), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{old_new_table}); %item = (__RULE__ => q{old_new_table}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/OLD_TABLE/i]}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:OLD_TABLE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: [/(AS)?/i]}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/(AS)?/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:(AS)?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [identifier]}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{identifier})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::identifier( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [identifier]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; $item{q{identifier}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = join(' ', @item[ 1 .. 3 ]) }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/OLD_TABLE/i /(AS)?/i identifier]<<}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NEW_TABLE/i /(AS)?/i identifier]}, Parse::RecDescent::_tracefirst($_[1]), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{old_new_table}); %item = (__RULE__ => q{old_new_table}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NEW_TABLE/i]}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NEW_TABLE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: [/(AS)?/i]}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/(AS)?/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:(AS)?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [identifier]}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{identifier})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::identifier( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [identifier]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; $item{q{identifier}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = join(' ', @item[ 1 .. 3 ]) }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/NEW_TABLE/i /(AS)?/i identifier]<<}, Parse::RecDescent::_tracefirst($text), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{old_new_table}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{old_new_table}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{old_new_table}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{old_new_table}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_numbering_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_numbering_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_numbering_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [window_order_clause window_aggregation_group_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_numbering_function}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_numbering_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [window_order_clause]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::window_order_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [window_order_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{window_order_clause}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: [window_aggregation_group_clause]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{window_aggregation_group_clause})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::window_aggregation_group_clause, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [window_aggregation_group_clause]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{window_aggregation_group_clause(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [window_order_clause window_aggregation_group_clause]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_numbering_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"} {"_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [result_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [result_expression]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::result_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [result_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{result_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [result_expression]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NULL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NULL/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NULL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/NULL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::old_new_corr { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"old_new_corr"}; Parse::RecDescent::_trace( q{Trying rule: [old_new_corr]}, Parse::RecDescent::_tracefirst($_[1]), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/OLD/i /(AS)?/i correlation_name]}, Parse::RecDescent::_tracefirst($_[1]), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{old_new_corr}); %item = (__RULE__ => q{old_new_corr}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/OLD/i]}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:OLD)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: [/(AS)?/i]}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/(AS)?/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:(AS)?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [correlation_name]}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{correlation_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::correlation_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [correlation_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; $item{q{correlation_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = join(' ', @item[ 1 .. 3 ]) }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/OLD/i /(AS)?/i correlation_name]<<}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NEW/i /(AS)?/i correlation_name]}, Parse::RecDescent::_tracefirst($_[1]), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{old_new_corr}); %item = (__RULE__ => q{old_new_corr}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NEW/i]}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NEW)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: [/(AS)?/i]}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/(AS)?/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:(AS)?)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [correlation_name]}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{correlation_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::correlation_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [correlation_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; $item{q{correlation_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = join(' ', @item[ 1 .. 3 ]) }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/NEW/i /(AS)?/i correlation_name]<<}, Parse::RecDescent::_tracefirst($text), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{old_new_corr}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{old_new_corr}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{old_new_corr}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{old_new_corr}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_42_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_42_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_42_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LCASE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_42_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_42_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LCASE/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LCASE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LCASE/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/LOWER/]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_42_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_42_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/LOWER/]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:LOWER)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/LOWER/]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_42_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::subtype_treatment { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"subtype_treatment"}; Parse::RecDescent::_trace( q{Trying rule: [subtype_treatment]}, Parse::RecDescent::_tracefirst($_[1]), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/TREAT/i '(' expression /AS/i data_type ')']}, Parse::RecDescent::_tracefirst($_[1]), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{subtype_treatment}); %item = (__RULE__ => q{subtype_treatment}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/TREAT/i]}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:TREAT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'('})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/AS/i]}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/AS/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:AS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [data_type]}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{data_type})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::data_type( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [data_type]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; $item{q{data_type}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/TREAT/i '(' expression /AS/i data_type ')']<<}, Parse::RecDescent::_tracefirst($text), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{subtype_treatment}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{subtype_treatment}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{subtype_treatment}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{subtype_treatment}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"expression"}; Parse::RecDescent::_trace( q{Trying rule: [expression]}, Parse::RecDescent::_tracefirst($_[1]), q{expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: []}, Parse::RecDescent::_tracefirst($_[1]), q{expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{expression}); %item = (__RULE__ => q{expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying operator: []}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{})->at($text); $_tok = undef; OPLOOP: while (1) { $repcount = 0; my @item; # MATCH LEFTARG Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_expression]}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{'+', or '-'})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_expression}} = $_tok; push @item, $_tok; } $repcount++; my $savetext = $text; my $backtrack; # MATCH (OP RIGHTARG)(s) while ($repcount < 100000000) { $backtrack = 0; Parse::RecDescent::_trace( q{Trying terminal: [/operator/]}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/operator/})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:operator)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; pop @item; if (defined $1) { push @item, $item{'_alternation_1_of_production_1_of_rule_expression(s)'} = $1; $backtrack = 1; } Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_expression]}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{'+', or '-'})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_expression}} = $_tok; push @item, $_tok; } $savetext = $text; $repcount++; } $text = $savetext; pop @item if $backtrack; unless (@item) { undef $_tok; last } $_tok = [@item]; last; } unless ($repcount >= 1) { Parse::RecDescent::_trace( q{<]>>}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched operator: []<< (return value: [} . qq{@{$_tok||[]}} . q{]}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; push @item, $item{'_alternation_1_of_production_1_of_rule_expression(s)'} = $_tok || []; Parse::RecDescent::_trace( q{>>Matched production: []<<}, Parse::RecDescent::_tracefirst($text), q{expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"} {"_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [function]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [function]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['(' expression ')']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['(' expression ')']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [constant]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [constant]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::constant( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [constant]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{constant}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [constant]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [column_name]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[3]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [column_name]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [column_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{column_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [column_name]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [host_variable]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[4]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [host_variable]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::host_variable( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [host_variable]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{host_variable}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [host_variable]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [special_register]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[5]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [special_register]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::special_register( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [special_register]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{special_register}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [special_register]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['(' scalar_fullselect ')']}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[6]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [scalar_fullselect]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{scalar_fullselect})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::scalar_fullselect( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [scalar_fullselect]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{scalar_fullselect}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: ['(' scalar_fullselect ')']<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [labeled_duration]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[7]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [labeled_duration]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::labeled_duration( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [labeled_duration]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{labeled_duration}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [labeled_duration]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [case_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[8]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [case_expression]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::case_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [case_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{case_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [case_expression]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [cast_specification]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[9]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [cast_specification]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::cast_specification( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [cast_specification]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{cast_specification}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [cast_specification]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [OLAP_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[10]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [OLAP_function]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::OLAP_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [OLAP_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{OLAP_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [OLAP_function]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [method_invocation]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[11]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [method_invocation]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::method_invocation( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [method_invocation]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{method_invocation}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [method_invocation]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [subtype_treatment]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[12]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [subtype_treatment]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::subtype_treatment( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [subtype_treatment]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{subtype_treatment}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [subtype_treatment]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [sequence_reference]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[13]; $text = $_[1]; my $_savetext; @item = (q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); %item = (__RULE__ => q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [sequence_reference]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::sequence_reference( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [sequence_reference]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{sequence_reference}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [sequence_reference]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::startrule { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"startrule"}; Parse::RecDescent::_trace( q{Trying rule: [startrule]}, Parse::RecDescent::_tracefirst($_[1]), q{startrule}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [statement eofile]}, Parse::RecDescent::_tracefirst($_[1]), q{startrule}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{startrule}); %item = (__RULE__ => q{startrule}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying repeated subrule: [statement]}, Parse::RecDescent::_tracefirst($text), q{startrule}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::statement, 1, 100000000, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{startrule}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [statement]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{startrule}, $tracelevel ) if defined $::RD_TRACE; $item{q{statement(s)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying subrule: [eofile]}, Parse::RecDescent::_tracefirst($text), q{startrule}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{eofile})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::eofile( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{startrule}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [eofile]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{startrule}, $tracelevel ) if defined $::RD_TRACE; $item{q{eofile}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{startrule}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = { tables => \%tables, views => \@views, triggers => \@triggers, }; }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [statement eofile]<<}, Parse::RecDescent::_tracefirst($text), q{startrule}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{startrule}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{startrule}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{startrule}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{startrule}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_cast_specification { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_cast_specification"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_cast_specification]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [expression]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_cast_specification}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_cast_specification}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [expression]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $item{q{expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [expression]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NULL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_cast_specification}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_cast_specification}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NULL/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NULL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/NULL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [parameter_marker]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_cast_specification}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_cast_specification}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [parameter_marker]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::parameter_marker( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [parameter_marker]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $item{q{parameter_marker}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [parameter_marker]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_cast_specification}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::before { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"before"}; Parse::RecDescent::_trace(q{Trying rule: [before]}, Parse::RecDescent::_tracefirst($_[1]), q{before}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NO CASCADE BEFORE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{before}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{before}); %item = (__RULE__ => q{before}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NO CASCADE BEFORE/i]}, Parse::RecDescent::_tracefirst($text), q{before}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NO CASCADE BEFORE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/NO CASCADE BEFORE/i]<<}, Parse::RecDescent::_tracefirst($text), q{before}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{before}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{before}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{before}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{before}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_83_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_83_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_83_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/UCASE/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_83_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_83_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/UCASE/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:UCASE)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/UCASE/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/UPPER/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_83_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_83_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/UPPER/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:UPPER)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/UPPER/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_83_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::ranking_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"ranking_function"}; Parse::RecDescent::_trace( q{Trying rule: [ranking_function]}, Parse::RecDescent::_tracefirst($_[1]), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/RANK/, or /DENSE_RANK|DENSERANK/i /OVER/i '(' window_partition_clause window_order_clause ')']}, Parse::RecDescent::_tracefirst($_[1]), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{ranking_function}); %item = (__RULE__ => q{ranking_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_ranking_function]}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_ranking_function( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_ranking_function]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_ranking_function}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/OVER/i]}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/OVER/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:OVER)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'('})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying repeated subrule: [window_partition_clause]}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{window_partition_clause})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::window_partition_clause, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [window_partition_clause]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{window_partition_clause(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{Trying subrule: [window_order_clause]}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{window_order_clause})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::window_order_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [window_order_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; $item{q{window_order_clause}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/RANK/, or /DENSE_RANK|DENSERANK/i /OVER/i '(' window_partition_clause window_order_clause ')']<<}, Parse::RecDescent::_tracefirst($text), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{ranking_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{ranking_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{ranking_function}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{ranking_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"} {"_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/SELECTIVITY/i numeric_constant]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/SELECTIVITY/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:SELECTIVITY)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [numeric_constant]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{numeric_constant})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::numeric_constant( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [numeric_constant]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $item{q{numeric_constant}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/SELECTIVITY/i numeric_constant]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ABS/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ABS/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ABS)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ABS/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ABSVAL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ABSVAL/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ABSVAL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/ABSVAL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::reference_b { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"reference_b"}; Parse::RecDescent::_trace( q{Trying rule: [reference_b]}, Parse::RecDescent::_tracefirst($_[1]), q{reference_b}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REFERENCING/i old_new_corr]}, Parse::RecDescent::_tracefirst($_[1]), q{reference_b}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{reference_b}); %item = (__RULE__ => q{reference_b}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REFERENCING/i]}, Parse::RecDescent::_tracefirst($text), q{reference_b}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REFERENCING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying repeated subrule: [old_new_corr]}, Parse::RecDescent::_tracefirst($text), q{reference_b}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{old_new_corr})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::old_new_corr, 0, 2, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{reference_b}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [old_new_corr]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{reference_b}, $tracelevel ) if defined $::RD_TRACE; $item{q{old_new_corr(0..2)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{reference_b}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = join(' ', $item[1], join(' ', @{ $item[2] })) }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/REFERENCING/i old_new_corr]<<}, Parse::RecDescent::_tracefirst($text), q{reference_b}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{reference_b}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{reference_b}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{reference_b}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{reference_b}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_simple_when_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_1_of_rule_simple_when_clause"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_1_of_rule_simple_when_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/WHEN/i search_condition /THEN/i result_expression, or /NULL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_1_of_rule_simple_when_clause}); %item = (__RULE__ => q{_alternation_1_of_production_1_of_rule_simple_when_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/WHEN/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:WHEN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [search_condition]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{search_condition})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::search_condition( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [search_condition]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{search_condition}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/THEN/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/THEN/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:THEN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{result_expression, or /NULL/i})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/WHEN/i search_condition /THEN/i result_expression, or /NULL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_1_of_rule_simple_when_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_9_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_9_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_9_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CORRELATION/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_9_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_9_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CORRELATION/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CORRELATION)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CORRELATION/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CORR/]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_9_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_9_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CORR/]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CORR)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CORR/]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_9_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_7_of_rule_sysfun { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_7_of_rule_sysfun"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_7_of_rule_sysfun]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CEIL/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_7_of_rule_sysfun}); %item = (__RULE__ => q{_alternation_1_of_production_7_of_rule_sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CEIL/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CEIL)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CEIL/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CEILING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_7_of_rule_sysfun}); %item = (__RULE__ => q{_alternation_1_of_production_7_of_rule_sysfun}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CEILING/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CEILING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CEILING/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_7_of_rule_sysfun}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::prevval_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"prevval_expression"}; Parse::RecDescent::_trace( q{Trying rule: [prevval_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{prevval_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/PREVVAL\\s+FOR/i sequence_name]}, Parse::RecDescent::_tracefirst($_[1]), q{prevval_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{prevval_expression}); %item = (__RULE__ => q{prevval_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/PREVVAL\\s+FOR/i]}, Parse::RecDescent::_tracefirst($text), q{prevval_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:PREVVAL\s+FOR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [sequence_name]}, Parse::RecDescent::_tracefirst($text), q{prevval_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{sequence_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::sequence_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{prevval_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [sequence_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{prevval_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{sequence_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/PREVVAL\\s+FOR/i sequence_name]<<}, Parse::RecDescent::_tracefirst($text), q{prevval_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{prevval_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{prevval_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{prevval_expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{prevval_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::where_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"where_clause"}; Parse::RecDescent::_trace( q{Trying rule: [where_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{where_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [WHERE search_condition]}, Parse::RecDescent::_tracefirst($_[1]), q{where_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{where_clause}); %item = (__RULE__ => q{where_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [WHERE]}, Parse::RecDescent::_tracefirst($text), q{where_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::WHERE( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{where_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [WHERE]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{where_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{WHERE}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying subrule: [search_condition]}, Parse::RecDescent::_tracefirst($text), q{where_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{search_condition})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::search_condition( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{where_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [search_condition]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{where_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{search_condition}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [WHERE search_condition]<<}, Parse::RecDescent::_tracefirst($text), q{where_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{where_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{where_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{where_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{where_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::group_start { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"group_start"}; Parse::RecDescent::_trace( q{Trying rule: [group_start]}, Parse::RecDescent::_tracefirst($_[1]), q{group_start}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/UNBOUNDED\\s+PRECEDING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_start}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{group_start}); %item = (__RULE__ => q{group_start}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/UNBOUNDED\\s+PRECEDING/i]}, Parse::RecDescent::_tracefirst($text), q{group_start}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:UNBOUNDED\s+PRECEDING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/UNBOUNDED\\s+PRECEDING/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_start}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [unsigned_constant /PRECEDING/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_start}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{group_start}); %item = (__RULE__ => q{group_start}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [unsigned_constant]}, Parse::RecDescent::_tracefirst($text), q{group_start}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::unsigned_constant( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{group_start}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [unsigned_constant]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{group_start}, $tracelevel ) if defined $::RD_TRACE; $item{q{unsigned_constant}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/PRECEDING/i]}, Parse::RecDescent::_tracefirst($text), q{group_start}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/PRECEDING/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:PRECEDING)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [unsigned_constant /PRECEDING/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_start}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/CURRENT\\s+ROW/i]}, Parse::RecDescent::_tracefirst($_[1]), q{group_start}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[2]; $text = $_[1]; my $_savetext; @item = (q{group_start}); %item = (__RULE__ => q{group_start}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/CURRENT\\s+ROW/i]}, Parse::RecDescent::_tracefirst($text), q{group_start}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:CURRENT\s+ROW)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/CURRENT\\s+ROW/i]<<}, Parse::RecDescent::_tracefirst($text), q{group_start}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{group_start}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{group_start}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{group_start}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{group_start}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::correlation_name { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"correlation_name"}; Parse::RecDescent::_trace( q{Trying rule: [correlation_name]}, Parse::RecDescent::_tracefirst($_[1]), q{correlation_name}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [NAME]}, Parse::RecDescent::_tracefirst($_[1]), q{correlation_name}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{correlation_name}); %item = (__RULE__ => q{correlation_name}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [NAME]}, Parse::RecDescent::_tracefirst($text), q{correlation_name}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::NAME( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{correlation_name}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [NAME]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{correlation_name}, $tracelevel ) if defined $::RD_TRACE; $item{q{NAME}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [NAME]<<}, Parse::RecDescent::_tracefirst($text), q{correlation_name}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{correlation_name}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{correlation_name}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{correlation_name}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{correlation_name}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::SQL_procedure_statement { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"SQL_procedure_statement"}; Parse::RecDescent::_trace( q{Trying rule: [SQL_procedure_statement]}, Parse::RecDescent::_tracefirst($_[1]), q{SQL_procedure_statement}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/[^;]*/ /(;|\\z)/]}, Parse::RecDescent::_tracefirst($_[1]), q{SQL_procedure_statement}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{SQL_procedure_statement}); %item = (__RULE__ => q{SQL_procedure_statement}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/[^;]*/]}, Parse::RecDescent::_tracefirst($text), q{SQL_procedure_statement}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:[^;]*)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying terminal: [/(;|\\z)/]}, Parse::RecDescent::_tracefirst($text), q{SQL_procedure_statement}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/(;|\\z)/})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:(;|\z))//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying action}, Parse::RecDescent::_tracefirst($text), q{SQL_procedure_statement}, $tracelevel ) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = $item[1] . $item[2] }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/[^;]*/ /(;|\\z)/]<<}, Parse::RecDescent::_tracefirst($text), q{SQL_procedure_statement}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{SQL_procedure_statement}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{SQL_procedure_statement}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{SQL_procedure_statement}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{SQL_procedure_statement}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::group_between { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"group_between"}; Parse::RecDescent::_trace( q{Trying rule: [group_between]}, Parse::RecDescent::_tracefirst($_[1]), q{group_between}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/BETWEEN/i group_bound1 /AND/i group_bound2]}, Parse::RecDescent::_tracefirst($_[1]), q{group_between}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{group_between}); %item = (__RULE__ => q{group_between}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/BETWEEN/i]}, Parse::RecDescent::_tracefirst($text), q{group_between}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:BETWEEN)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [group_bound1]}, Parse::RecDescent::_tracefirst($text), q{group_between}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{group_bound1})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::group_bound1( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{group_between}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [group_bound1]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{group_between}, $tracelevel ) if defined $::RD_TRACE; $item{q{group_bound1}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: [/AND/i]}, Parse::RecDescent::_tracefirst($text), q{group_between}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/AND/i})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:AND)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [group_bound2]}, Parse::RecDescent::_tracefirst($text), q{group_between}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{group_bound2})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::group_bound2( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{group_between}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [group_bound2]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{group_between}, $tracelevel ) if defined $::RD_TRACE; $item{q{group_bound2}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/BETWEEN/i group_bound1 /AND/i group_bound2]<<}, Parse::RecDescent::_tracefirst($text), q{group_between}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{group_between}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{group_between}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{group_between}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{group_between}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::nextval_expression { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"nextval_expression"}; Parse::RecDescent::_trace( q{Trying rule: [nextval_expression]}, Parse::RecDescent::_tracefirst($_[1]), q{nextval_expression}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/NEXTVAL\\s+FOR/i sequence_name]}, Parse::RecDescent::_tracefirst($_[1]), q{nextval_expression}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{nextval_expression}); %item = (__RULE__ => q{nextval_expression}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/NEXTVAL\\s+FOR/i]}, Parse::RecDescent::_tracefirst($text), q{nextval_expression}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:NEXTVAL\s+FOR)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [sequence_name]}, Parse::RecDescent::_tracefirst($text), q{nextval_expression}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{sequence_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::sequence_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{nextval_expression}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [sequence_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{nextval_expression}, $tracelevel ) if defined $::RD_TRACE; $item{q{sequence_name}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{>>Matched production: [/NEXTVAL\\s+FOR/i sequence_name]<<}, Parse::RecDescent::_tracefirst($text), q{nextval_expression}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{nextval_expression}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{nextval_expression}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{nextval_expression}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{nextval_expression}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::desc_option { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"desc_option"}; Parse::RecDescent::_trace( q{Trying rule: [desc_option]}, Parse::RecDescent::_tracefirst($_[1]), q{desc_option}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/DESC/i /NULLS\\s+FIRST/i, or /NULLS\\s+LAST/i]}, Parse::RecDescent::_tracefirst($_[1]), q{desc_option}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{desc_option}); %item = (__RULE__ => q{desc_option}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/DESC/i]}, Parse::RecDescent::_tracefirst($text), q{desc_option}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:DESC)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying repeated subrule: [/NULLS\\s+FIRST/i, or /NULLS\\s+LAST/i]}, Parse::RecDescent::_tracefirst($text), q{desc_option}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{/NULLS\\s+FIRST/i, or /NULLS\\s+LAST/i}) ->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_desc_option, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{desc_option}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule_desc_option]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{desc_option}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_desc_option(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/DESC/i /NULLS\\s+FIRST/i, or /NULLS\\s+LAST/i]<<}, Parse::RecDescent::_tracefirst($text), q{desc_option}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{desc_option}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{desc_option}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{desc_option}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{desc_option}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_list { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"column_list"}; Parse::RecDescent::_trace( q{Trying rule: [column_list]}, Parse::RecDescent::_tracefirst($_[1]), q{column_list}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: ['(' ')']}, Parse::RecDescent::_tracefirst($_[1]), q{column_list}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{column_list}); %item = (__RULE__ => q{column_list}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: ['(']}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\(//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying operator: []}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{}) ->at($text); $_tok = undef; OPLOOP: while (1) { $repcount = 0; my @item; # MATCH LEFTARG Parse::RecDescent::_trace( q{Trying subrule: [column_name]}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{column_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [column_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; $item{q{column_name}} = $_tok; push @item, $_tok; } $repcount++; my $savetext = $text; my $backtrack; # MATCH (OP RIGHTARG)(s) while ($repcount < 100000000) { $backtrack = 0; Parse::RecDescent::_trace( q{Trying terminal: [/,/]}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/,/})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:,)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; pop @item; if (defined $1) { push @item, $item{'column_name(s)'} = $1; $backtrack = 1; } Parse::RecDescent::_trace( q{Trying subrule: [column_name]}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{column_name})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::column_name( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [column_name]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; $item{q{column_name}} = $_tok; push @item, $_tok; } $savetext = $text; $repcount++; } $text = $savetext; pop @item if $backtrack; unless (@item) { undef $_tok; last } $_tok = [@item]; last; } unless ($repcount >= 1) { Parse::RecDescent::_trace( q{<]>>}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched operator: []<< (return value: [} . qq{@{$_tok||[]}} . q{]}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; push @item, $item{'column_name(s)'} = $_tok || []; Parse::RecDescent::_trace( q{Trying terminal: [')']}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{')'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\)//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING2__} = $&; Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { $return = join(' ', '(', @{ $item[2] }, ')'); }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: ['(' ')']<<}, Parse::RecDescent::_tracefirst($text), q{column_list}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{column_list}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{column_list}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{column_list}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{column_list}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_63_of_rule_sysibm_function { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"_alternation_1_of_production_63_of_rule_sysibm_function"}; Parse::RecDescent::_trace( q{Trying rule: [_alternation_1_of_production_63_of_rule_sysibm_function]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_INTERCEPT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_63_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_63_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REGR_INTERCEPT/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REGR_INTERCEPT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REGR_INTERCEPT/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/REGR_ICPT/i]}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[1]; $text = $_[1]; my $_savetext; @item = (q{_alternation_1_of_production_63_of_rule_sysibm_function}); %item = (__RULE__ => q{_alternation_1_of_production_63_of_rule_sysibm_function}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/REGR_ICPT/i]}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:REGR_ICPT)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/REGR_ICPT/i]<<}, Parse::RecDescent::_tracefirst($text), q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace( q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel ); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{_alternation_1_of_production_63_of_rule_sysibm_function}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::dereference_operation { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"dereference_operation"}; Parse::RecDescent::_trace( q{Trying rule: [dereference_operation]}, Parse::RecDescent::_tracefirst($_[1]), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [scoped_reference_expression '->' name1 '(']}, Parse::RecDescent::_tracefirst($_[1]), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{dereference_operation}); %item = (__RULE__ => q{dereference_operation}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying subrule: [scoped_reference_expression]}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::scoped_reference_expression( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [scoped_reference_expression]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $item{q{scoped_reference_expression}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying terminal: ['->']}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{'->'})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A\-\>//) { $expectation->failed(); Parse::RecDescent::_trace(qq{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__STRING1__} = $&; Parse::RecDescent::_trace( q{Trying subrule: [name1]}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{name1})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::name1( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [name1]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $item{q{name1}} = $_tok; push @item, $_tok; } Parse::RecDescent::_trace( q{Trying repeated subrule: ['(']}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{'('})->at($text); unless (defined( $_tok = $thisparser->_parserepeat( $text, \&Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_dereference_operation, 0, 1, $_noactions, $expectation, undef ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace( q{>>Matched repeated subrule: [_alternation_1_of_production_1_of_rule_dereference_operation]<< (} . @$_tok . q{ times)}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_dereference_operation(?)}} = $_tok; push @item, $_tok; Parse::RecDescent::_trace( q{>>Matched production: [scoped_reference_expression '->' name1 '(']<<}, Parse::RecDescent::_tracefirst($text), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{dereference_operation}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{dereference_operation}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{dereference_operation}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{dereference_operation}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::OUTER { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"OUTER"}; Parse::RecDescent::_trace(q{Trying rule: [OUTER]}, Parse::RecDescent::_tracefirst($_[1]), q{OUTER}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/outer/i]}, Parse::RecDescent::_tracefirst($_[1]), q{OUTER}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{OUTER}); %item = (__RULE__ => q{OUTER}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/outer/i]}, Parse::RecDescent::_tracefirst($text), q{OUTER}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:outer)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/outer/i]<<}, Parse::RecDescent::_tracefirst($text), q{OUTER}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{OUTER}, $tracelevel) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{OUTER}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{OUTER}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{OUTER}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::window_order_clause { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"window_order_clause"}; Parse::RecDescent::_trace( q{Trying rule: [window_order_clause]}, Parse::RecDescent::_tracefirst($_[1]), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/ORDER\\s+BY/i ]}, Parse::RecDescent::_tracefirst($_[1]), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{window_order_clause}); %item = (__RULE__ => q{window_order_clause}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/ORDER\\s+BY/i]}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:ORDER\s+BY)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{Trying operator: []}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->is(q{}) ->at($text); $_tok = undef; OPLOOP: while (1) { $repcount = 0; my @item; # MATCH LEFTARG Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_window_order_clause]}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{sort_key_expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_window_order_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_window_order_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_window_order_clause}} = $_tok; push @item, $_tok; } $repcount++; my $savetext = $text; my $backtrack; # MATCH (OP RIGHTARG)(s) while ($repcount < 100000000) { $backtrack = 0; Parse::RecDescent::_trace( q{Trying terminal: [/,/]}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{/,/})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:,)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN2__} = $&; pop @item; if (defined $1) { push @item, $item{'_alternation_1_of_production_1_of_rule_window_order_clause(s)'} = $1; $backtrack = 1; } Parse::RecDescent::_trace( q{Trying subrule: [_alternation_1_of_production_1_of_rule_window_order_clause]}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; if (1) { no strict qw{refs}; $expectation->is(q{sort_key_expression})->at($text); unless (defined( $_tok = Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::_alternation_1_of_production_1_of_rule_window_order_clause( $thisparser, $text, $repeating, $_noactions, sub { \@arg } ) )) { Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched subrule: [_alternation_1_of_production_1_of_rule_window_order_clause]<< (return value: [} . $_tok . q{]}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $item{q{_alternation_1_of_production_1_of_rule_window_order_clause}} = $_tok; push @item, $_tok; } $savetext = $text; $repcount++; } $text = $savetext; pop @item if $backtrack; unless (@item) { undef $_tok; last } $_tok = [@item]; last; } unless ($repcount >= 1) { Parse::RecDescent::_trace( q{<]>>}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $expectation->failed(); last; } Parse::RecDescent::_trace( q{>>Matched operator: []<< (return value: [} . qq{@{$_tok||[]}} . q{]}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; push @item, $item{'_alternation_1_of_production_1_of_rule_window_order_clause(s)'} = $_tok || []; Parse::RecDescent::_trace( q{>>Matched production: [/ORDER\\s+BY/i ]<<}, Parse::RecDescent::_tracefirst($text), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{window_order_clause}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{window_order_clause}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{window_order_clause}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{window_order_clause}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::TRIGGER { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"TRIGGER"}; Parse::RecDescent::_trace(q{Trying rule: [TRIGGER]}, Parse::RecDescent::_tracefirst($_[1]), q{TRIGGER}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/trigger/i]}, Parse::RecDescent::_tracefirst($_[1]), q{TRIGGER}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{TRIGGER}); %item = (__RULE__ => q{TRIGGER}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/trigger/i]}, Parse::RecDescent::_tracefirst($text), q{TRIGGER}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:trigger)//i) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace( q{>>Matched production: [/trigger/i]<<}, Parse::RecDescent::_tracefirst($text), q{TRIGGER}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{TRIGGER}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{TRIGGER}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{TRIGGER}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{TRIGGER}, $tracelevel ); } $_[1] = $text; return $return; } # ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args) sub Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar::comment { my $thisparser = $_[0]; use vars q{$tracelevel}; local $tracelevel = ($tracelevel || 0) + 1; $ERRORS = 0; my $thisrule = $thisparser->{"rules"}{"comment"}; Parse::RecDescent::_trace(q{Trying rule: [comment]}, Parse::RecDescent::_tracefirst($_[1]), q{comment}, $tracelevel) if defined $::RD_TRACE; my $err_at = @{ $thisparser->{errors} }; my $score; my $score_return; my $_tok; my $return = undef; my $_matched = 0; my $commit = 0; my @item = (); my %item = (); my $repeating = defined($_[2]) && $_[2]; my $_noactions = defined($_[3]) && $_[3]; my @arg = defined $_[4] ? @{ &{ $_[4] } } : (); my %arg = ($#arg & 01) ? @arg : (@arg, undef); my $text; my $lastsep = ""; my $expectation = new Parse::RecDescent::Expectation($thisrule->expected()); $expectation->at($_[1]); my $thisline; tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser; while (!$_matched && !$commit) { Parse::RecDescent::_trace( q{Trying production: [/^\\s*-\{2\}.*\\n/]}, Parse::RecDescent::_tracefirst($_[1]), q{comment}, $tracelevel ) if defined $::RD_TRACE; my $thisprod = $thisrule->{"prods"}[0]; $text = $_[1]; my $_savetext; @item = (q{comment}); %item = (__RULE__ => q{comment}); my $repcount = 0; Parse::RecDescent::_trace( q{Trying terminal: [/^\\s*-\{2\}.*\\n/]}, Parse::RecDescent::_tracefirst($text), q{comment}, $tracelevel ) if defined $::RD_TRACE; $lastsep = ""; $expectation->is(q{})->at($text); unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and $text =~ s/\A(?:^\s*-{2}.*\n)//) { $expectation->failed(); Parse::RecDescent::_trace(q{<>}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [} . $& . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $item{__PATTERN1__} = $&; Parse::RecDescent::_trace(q{Trying action}, Parse::RecDescent::_tracefirst($text), q{comment}, $tracelevel) if defined $::RD_TRACE; $_tok = ($_noactions) ? 0 : do { my $comment = $item[1]; $comment =~ s/^\s*(-{2})\s*//; $comment =~ s/\s*$//; $return = $comment; }; unless (defined $_tok) { Parse::RecDescent::_trace(q{<> (return value: [undef])}) if defined $::RD_TRACE; last; } Parse::RecDescent::_trace(q{>>Matched action<< (return value: [} . $_tok . q{])}, Parse::RecDescent::_tracefirst($text)) if defined $::RD_TRACE; push @item, $_tok; $item{__ACTION1__} = $_tok; Parse::RecDescent::_trace( q{>>Matched production: [/^\\s*-\{2\}.*\\n/]<<}, Parse::RecDescent::_tracefirst($text), q{comment}, $tracelevel ) if defined $::RD_TRACE; $_matched = 1; last; } unless ($_matched || defined($return) || defined($score)) { $_[1] = $text; # NOT SURE THIS IS NEEDED Parse::RecDescent::_trace( q{<>}, Parse::RecDescent::_tracefirst($_[1]), q{comment}, $tracelevel ) if defined $::RD_TRACE; return undef; } if (!defined($return) && defined($score)) { Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "", q{comment}, $tracelevel) if defined $::RD_TRACE; $return = $score_return; } splice @{ $thisparser->{errors} }, $err_at; $return = $item[$#item] unless defined $return; if (defined $::RD_TRACE) { Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} . $return . q{])}, "", q{comment}, $tracelevel); Parse::RecDescent::_trace( q{(consumed: [} . Parse::RecDescent::_tracemax(substr($_[1], 0, -length($text))) . q{])}, Parse::RecDescent::_tracefirst($text), , q{comment}, $tracelevel ); } $_[1] = $text; return $return; } } package SQL::Translator::Parser::DB2::Grammar; sub new { my $self = bless( { '_AUTOTREE' => undef, 'localvars' => '', 'startcode' => '', '_check' => { 'thisoffset' => '', 'itempos' => '', 'prevoffset' => '', 'prevline' => '', 'prevcolumn' => '', 'thiscolumn' => '' }, 'namespace' => 'Parse::RecDescent::SQL::Translator::Parser::DB2::Grammar', '_AUTOACTION' => undef, 'rules' => { '_alternation_1_of_production_17_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DECIMAL', 'hashname' => '__PATTERN1__', 'description' => '/DECIMAL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DEC', 'hashname' => '__PATTERN1__', 'description' => '/DEC/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_17_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'triggered_action' => bless( { 'impcount' => 0, 'calls' => [ 'when_clause', 'SQL_procedure_statement' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'when_clause', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 263 }, 'Parse::RecDescent::Repetition' ), bless( { 'subrule' => 'SQL_procedure_statement', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 263 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 264, 'code' => '{ $return = { \'condition\' => $item[1][0], \'statement\' => $item{\'SQL_procedure_statement\'} }; }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'triggered_action', 'vars' => '', 'line' => 263 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_2_of_rule_search_condition' => bless( { 'impcount' => 0, 'calls' => [ 'predicate', '_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition', 'search_condition' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'predicate', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition', 'expected' => '/SELECTIVITY/i', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'search_condition', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Literal' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_2_of_rule_search_condition', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'name1' => bless( { 'impcount' => 0, 'calls' => ['NAME'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 536 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'name1', 'vars' => '', 'line' => 536 }, 'Parse::RecDescent::Rule' ), '_alternation_2_of_production_1_of_rule_cond' => bless( { 'impcount' => 0, 'calls' => [ 'predicate', '_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond', 'search_condition' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'predicate', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond', 'expected' => '/SELECTIVITY/i', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'search_condition', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Literal' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_2_of_production_1_of_rule_cond', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_expression' => bless( { 'impcount' => 2, 'calls' => [ '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression', '_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression', 'expected' => '\'+\', or \'-\'', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 611 }, 'Parse::RecDescent::Repetition' ), bless( { 'subrule' => '_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression', 'matchrule' => 0, 'implicit' => 'function, or \'(\', or constant, or column_name, or host_variable, or special_register, or labeled_duration, or case_expression, or cast_specification, or OLAP_function, or method_invocation, or subtype_treatment, or sequence_reference', 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_expression', 'vars' => '', 'line' => 608 }, 'Parse::RecDescent::Rule' ), 'SCHEMA' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '\\w+', 'hashname' => '__PATTERN1__', 'description' => '/\\\\w+/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 142, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '\\w{1,128}', 'hashname' => '__PATTERN1__', 'description' => '/\\\\w\\{1,128\\}/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 144, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'SCHEMA', 'vars' => '', 'line' => 142 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_87_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'VARIANCE', 'hashname' => '__PATTERN1__', 'description' => '/VARIANCE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'VAR', 'hashname' => '__PATTERN1__', 'description' => '/VAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_87_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '+', 'hashname' => '__STRING1__', 'description' => '\'+\'', 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '-', 'hashname' => '__STRING1__', 'description' => '\'-\'', 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Literal' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), 'get_bracketed' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 170, 'code' => '{ extract_bracketed($text, \'(\'); }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'get_bracketed', 'vars' => '', 'line' => 169 }, 'Parse::RecDescent::Rule' ), 'labeled_duration' => bless( { 'impcount' => 0, 'calls' => [ 'ld_type', 'ld_duration' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'ld_type', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 480 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'ld_duration', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 480 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'labeled_duration', 'vars' => '', 'line' => 480 }, 'Parse::RecDescent::Rule' ), 'group_end' => bless( { 'impcount' => 0, 'calls' => ['unsigned_constant'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'UNBOUNDED\\s+PRECEDING', 'hashname' => '__PATTERN1__', 'description' => '/UNBOUNDED\\\\s+PRECEDING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 590, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'unsigned_constant', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 591 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'FOLLOWING', 'hashname' => '__PATTERN1__', 'description' => '/FOLLOWING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 591, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 591 }, 'Parse::RecDescent::Production' ) ], 'name' => 'group_end', 'vars' => '', 'line' => 590 }, 'Parse::RecDescent::Rule' ), 'statement' => bless( { 'impcount' => 0, 'calls' => [ 'comment', 'create' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'comment', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 23 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'create', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 24 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 24 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 1, 'uncommit' => 0, 'error' => 1, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'msg' => '', 'hashname' => '__DIRECTIVE1__', 'commitonly' => '', 'lookahead' => 0, 'line' => 25 }, 'Parse::RecDescent::Error' ) ], 'line' => 25 }, 'Parse::RecDescent::Production' ) ], 'name' => 'statement', 'vars' => '', 'line' => 22 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause' => bless( { 'impcount' => 0, 'calls' => ['result_expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'result_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NULL', 'hashname' => '__PATTERN1__', 'description' => '/NULL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 627, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), '_alternation_2_of_production_1_of_rule_case_expression' => bless( { 'impcount' => 0, 'calls' => ['result_expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ELSE\\s+NULL', 'hashname' => '__PATTERN1__', 'description' => '/ELSE\\\\s+NULL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 626, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ELSE', 'hashname' => '__PATTERN1__', 'description' => '/ELSE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 627, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'result_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_2_of_production_1_of_rule_case_expression', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), 'subject_expression' => bless( { 'impcount' => 0, 'calls' => ['expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 598 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 599, 'code' => '{ # with static result type that is a used-defined struct type }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'subject_expression', 'vars' => '', 'line' => 598 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_desc_option' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NULLS\\s+FIRST', 'hashname' => '__PATTERN1__', 'description' => '/NULLS\\\\s+FIRST/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NULLS\\s+LAST', 'hashname' => '__PATTERN1__', 'description' => '/NULLS\\\\s+LAST/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_desc_option', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'view_name' => bless( { 'impcount' => 0, 'calls' => [ 'SCHEMA', 'NAME' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'SCHEMA', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 129 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => '.', 'hashname' => '__STRING1__', 'description' => '\'.\'', 'lookahead' => 0, 'line' => 129 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 129 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 130, 'code' => '{ $return = { schema => $item[1], name => $item[3] } }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 131 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 132, 'code' => '{ $return = { name => $item[1] } }' }, 'Parse::RecDescent::Action' ) ], 'line' => 131 }, 'Parse::RecDescent::Production' ) ], 'name' => 'view_name', 'vars' => '', 'line' => 129 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_cond' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'AND', 'hashname' => '__PATTERN1__', 'description' => '/AND/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'OR', 'hashname' => '__PATTERN1__', 'description' => '/OR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_cond', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'numbering_function' => bless( { 'impcount' => 2, 'calls' => [ 'window_partition_clause', '_alternation_1_of_production_1_of_rule_numbering_function', '_alternation_2_of_production_1_of_rule_numbering_function' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 3, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ROW_NUMBER|ROWNUMBER', 'hashname' => '__PATTERN1__', 'description' => '/ROW_NUMBER|ROWNUMBER/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 546, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '()', 'hashname' => '__STRING1__', 'description' => '\'()\'', 'lookahead' => 0, 'line' => 546 }, 'Parse::RecDescent::Literal' ), bless( { 'pattern' => 'OVER', 'hashname' => '__PATTERN2__', 'description' => '/OVER/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 546, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(', 'hashname' => '__STRING2__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 546 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'window_partition_clause', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 546 }, 'Parse::RecDescent::Repetition' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_numbering_function', 'expected' => 'window_order_clause', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 548 }, 'Parse::RecDescent::Repetition' ), bless( { 'subrule' => '_alternation_2_of_production_1_of_rule_numbering_function', 'expected' => '/RANGE\\\\s+BETWEEN\\\\s+UNBOUNDED\\\\s+PRECEDING\\\\s+AND\\\\s+UNBBOUNDED\\\\s+FOLLOWING/i, or window_aggregation_group_clause', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 551 }, 'Parse::RecDescent::Repetition' ), bless( { 'pattern' => ')', 'hashname' => '__STRING3__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 551 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'numbering_function', 'vars' => '', 'line' => 546 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_window_aggregation_group_clause' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ROWS', 'hashname' => '__PATTERN1__', 'description' => '/ROWS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 626, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'RANGE', 'hashname' => '__PATTERN1__', 'description' => '/RANGE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 627, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_window_aggregation_group_clause', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), 'group_bound1' => bless( { 'impcount' => 0, 'calls' => ['unsigned_constant'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'UNBOUNDED\\s+PRECEDING', 'hashname' => '__PATTERN1__', 'description' => '/UNBOUNDED\\\\s+PRECEDING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 580, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'unsigned_constant', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 581 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'PRECEDING', 'hashname' => '__PATTERN1__', 'description' => '/PRECEDING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 581, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 581 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'unsigned_constant', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 582 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'FOLLOWING', 'hashname' => '__PATTERN1__', 'description' => '/FOLLOWING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 582, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 582 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '3', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CURRENT\\s+ROW', 'hashname' => '__PATTERN1__', 'description' => '/CURRENT\\\\s+ROW/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 583, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 583 }, 'Parse::RecDescent::Production' ) ], 'name' => 'group_bound1', 'vars' => '', 'line' => 580 }, 'Parse::RecDescent::Rule' ), 'OLAP_function' => bless( { 'impcount' => 0, 'calls' => [ 'ranking_function', 'numbering_function', 'aggregation_function' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'ranking_function', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 538 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'numbering_function', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 539 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 539 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'aggregation_function', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 540 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 540 }, 'Parse::RecDescent::Production' ) ], 'name' => 'OLAP_function', 'vars' => '', 'line' => 538 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_30_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DOUBLE', 'hashname' => '__PATTERN1__', 'description' => '/DOUBLE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DOUBLE_PRECISION', 'hashname' => '__PATTERN1__', 'description' => '/DOUBLE_PRECISION/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_30_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'FULL' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'full', 'hashname' => '__PATTERN1__', 'description' => '/full/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 113, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'FULL', 'vars' => '', 'line' => 113 }, 'Parse::RecDescent::Rule' ), '_alternation_2_of_production_1_of_rule_cast_specification' => bless( { 'impcount' => 1, 'calls' => ['_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SCOPE', 'hashname' => '__PATTERN1__', 'description' => '/SCOPE/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 625, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification', 'matchrule' => 0, 'implicit' => 'typed_table_name, or typed_view_name', 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_2_of_production_1_of_rule_cast_specification', 'vars' => '', 'line' => 625 }, 'Parse::RecDescent::Rule' ), 'case_expression' => bless( { 'impcount' => 2, 'calls' => [ '_alternation_1_of_production_1_of_rule_case_expression', '_alternation_2_of_production_1_of_rule_case_expression' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CASE', 'hashname' => '__PATTERN1__', 'description' => '/CASE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 496, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_case_expression', 'matchrule' => 0, 'implicit' => 'searched_when_clause, or simple_when_clause', 'argcode' => undef, 'lookahead' => 0, 'line' => 498 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => '_alternation_2_of_production_1_of_rule_case_expression', 'expected' => '/ELSE\\\\s+NULL/i, or /ELSE/i', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 501 }, 'Parse::RecDescent::Repetition' ), bless( { 'pattern' => 'END', 'hashname' => '__PATTERN2__', 'description' => '/END/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 501, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'case_expression', 'vars' => '', 'line' => 496 }, 'Parse::RecDescent::Rule' ), 'operator' => bless( { 'impcount' => 0, 'calls' => ['_alternation_1_of_production_1_of_rule_operator'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_operator', 'matchrule' => 0, 'implicit' => '/CONCAT/i, or \'||\'', 'argcode' => undef, 'lookahead' => 0, 'line' => 321 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '/', 'hashname' => '__STRING1__', 'description' => '\'/\'', 'lookahead' => 0, 'line' => 321 }, 'Parse::RecDescent::Literal' ) ], 'line' => 321 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '*', 'hashname' => '__STRING1__', 'description' => '\'*\'', 'lookahead' => 0, 'line' => 321 }, 'Parse::RecDescent::Literal' ) ], 'line' => 321 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '3', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '+', 'hashname' => '__STRING1__', 'description' => '\'+\'', 'lookahead' => 0, 'line' => 321 }, 'Parse::RecDescent::Literal' ) ], 'line' => 321 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '4', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '-', 'hashname' => '__STRING1__', 'description' => '\'-\'', 'lookahead' => 0, 'line' => 321 }, 'Parse::RecDescent::Literal' ) ], 'line' => 321 }, 'Parse::RecDescent::Production' ) ], 'name' => 'operator', 'vars' => '', 'line' => 321 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_2_of_rule_type' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'INSERT', 'hashname' => '__PATTERN1__', 'description' => '/INSERT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DELETE', 'hashname' => '__PATTERN1__', 'description' => '/DELETE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'UPDATE', 'hashname' => '__PATTERN1__', 'description' => '/UPDATE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_2_of_rule_type', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_8_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CONCAT', 'hashname' => '__PATTERN1__', 'description' => '/CONCAT/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '||', 'hashname' => '__STRING1__', 'description' => '\'||\'', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Literal' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_8_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'sequence_reference' => bless( { 'impcount' => 0, 'calls' => [ 'nextval_expression', 'prevval_expression' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'nextval_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 608 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'prevval_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 609 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 609 }, 'Parse::RecDescent::Production' ) ], 'name' => 'sequence_reference', 'vars' => '', 'line' => 608 }, 'Parse::RecDescent::Rule' ), 'sysibm_function' => bless( { 'impcount' => 0, 'calls' => [ '_alternation_1_of_production_1_of_rule_sysibm_function', '_alternation_1_of_production_8_of_rule_sysibm_function', '_alternation_1_of_production_9_of_rule_sysibm_function', '_alternation_1_of_production_12_of_rule_sysibm_function', '_alternation_1_of_production_17_of_rule_sysibm_function', '_alternation_1_of_production_30_of_rule_sysibm_function', '_alternation_1_of_production_41_of_rule_sysibm_function', '_alternation_1_of_production_42_of_rule_sysibm_function', '_alternation_1_of_production_63_of_rule_sysibm_function', '_alternation_1_of_production_83_of_rule_sysibm_function', '_alternation_1_of_production_87_of_rule_sysibm_function' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/ABS/i, or /ABSVAL/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 332 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'AVG', 'hashname' => '__PATTERN1__', 'description' => '/AVG/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 333, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 333 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'BIGINT', 'hashname' => '__PATTERN1__', 'description' => '/BIGINT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 334, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 334 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '3', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'BLOB', 'hashname' => '__PATTERN1__', 'description' => '/BLOB/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 335, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 335 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '4', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CHAR', 'hashname' => '__PATTERN1__', 'description' => '/CHAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 336, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 336 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '5', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CLOB', 'hashname' => '__PATTERN1__', 'description' => '/CLOB/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 337, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 337 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '6', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'COALESCE', 'hashname' => '__PATTERN1__', 'description' => '/COALESCE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 338, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 338 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '7', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_8_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/CONCAT/, or \'||\'', 'argcode' => undef, 'lookahead' => 0, 'line' => 339 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 339 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '8', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_9_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/CORRELATION/i, or /CORR/', 'argcode' => undef, 'lookahead' => 0, 'line' => 340 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 340 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '9', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'COUNT', 'hashname' => '__PATTERN1__', 'description' => '/COUNT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 341, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 341 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '10', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'COUNT_BIG', 'hashname' => '__PATTERN1__', 'description' => '/COUNT_BIG/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 342, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 342 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '11', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_12_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/COVARIANCE/i, or /COVAR/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 343 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 343 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '12', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DATE', 'hashname' => '__PATTERN1__', 'description' => '/DATE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 344, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 344 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '13', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DAY', 'hashname' => '__PATTERN1__', 'description' => '/DAY/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 345, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 345 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '14', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DAYS', 'hashname' => '__PATTERN1__', 'description' => '/DAYS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 346, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 346 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '15', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DBCLOB', 'hashname' => '__PATTERN1__', 'description' => '/DBCLOB/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 347, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 347 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '16', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_17_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/DECIMAL/i, or /DEC/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 348 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 348 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '17', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DECRYPT_BIN', 'hashname' => '__PATTERN1__', 'description' => '/DECRYPT_BIN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 349, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 349 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '18', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DECRYPT_CHAR', 'hashname' => '__PATTERN1__', 'description' => '/DECRYPT_CHAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 350, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 350 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '19', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DEREF', 'hashname' => '__PATTERN1__', 'description' => '/DEREF/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 351, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 351 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '20', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DIGITS', 'hashname' => '__PATTERN1__', 'description' => '/DIGITS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 352, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 352 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '21', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DLCOMMENT', 'hashname' => '__PATTERN1__', 'description' => '/DLCOMMENT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 353, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 353 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '22', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DLLINKTYPE', 'hashname' => '__PATTERN1__', 'description' => '/DLLINKTYPE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 354, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 354 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '23', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DLURLCOMPLETE', 'hashname' => '__PATTERN1__', 'description' => '/DLURLCOMPLETE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 355, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 355 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '24', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DLURLPATH', 'hashname' => '__PATTERN1__', 'description' => '/DLURLPATH/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 356, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 356 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '25', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DLURLPATHONLY', 'hashname' => '__PATTERN1__', 'description' => '/DLURLPATHONLY/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 357, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 357 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '26', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DLURLSCHEME', 'hashname' => '__PATTERN1__', 'description' => '/DLURLSCHEME/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 358, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 358 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '27', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DLURLSERVER', 'hashname' => '__PATTERN1__', 'description' => '/DLURLSERVER/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 359, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 359 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '28', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DLVALUE', 'hashname' => '__PATTERN1__', 'description' => '/DLVALUE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 360, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 360 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '29', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_30_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/DOUBLE/i, or /DOUBLE_PRECISION/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 361 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 361 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '30', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ENCRYPT', 'hashname' => '__PATTERN1__', 'description' => '/ENCRYPT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 362, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 362 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '31', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'EVENT_MON_STATE', 'hashname' => '__PATTERN1__', 'description' => '/EVENT_MON_STATE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 363, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 363 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '32', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'FLOAT', 'hashname' => '__PATTERN1__', 'description' => '/FLOAT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 364, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 364 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '33', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'GETHINT', 'hashname' => '__PATTERN1__', 'description' => '/GETHINT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 365, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 365 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '34', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'GENERATE_UNIQUE', 'hashname' => '__PATTERN1__', 'description' => '/GENERATE_UNIQUE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 366, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 366 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '35', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'GRAPHIC', 'hashname' => '__PATTERN1__', 'description' => '/GRAPHIC/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 367, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 367 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '36', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'GROUPING', 'hashname' => '__PATTERN1__', 'description' => '/GROUPING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 368, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 368 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '37', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'HEX', 'hashname' => '__PATTERN1__', 'description' => '/HEX/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 369, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 369 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '38', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'HOUR', 'hashname' => '__PATTERN1__', 'description' => '/HOUR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 370, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 370 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '39', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'IDENTITY_VAL_LOCAL', 'hashname' => '__PATTERN1__', 'description' => '/IDENTITY_VAL_LOCAL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 371, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 371 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '40', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_41_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/INTEGER/i, or /INT/', 'argcode' => undef, 'lookahead' => 0, 'line' => 372 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 372 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '41', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_42_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/LCASE/i, or /LOWER/', 'argcode' => undef, 'lookahead' => 0, 'line' => 373 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 373 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '42', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LENGTH', 'hashname' => '__PATTERN1__', 'description' => '/LENGTH/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 374, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 374 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '43', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LONG_VARCHAR', 'hashname' => '__PATTERN1__', 'description' => '/LONG_VARCHAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 375, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 375 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '44', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LONG_VARGRAPHIC', 'hashname' => '__PATTERN1__', 'description' => '/LONG_VARGRAPHIC/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 376, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 376 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '45', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LTRIM', 'hashname' => '__PATTERN1__', 'description' => '/LTRIM/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 377, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 377 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '46', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MAX', 'hashname' => '__PATTERN1__', 'description' => '/MAX/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 378, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 378 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '47', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MICROSECOND', 'hashname' => '__PATTERN1__', 'description' => '/MICROSECOND/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 379, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 379 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '48', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MIN', 'hashname' => '__PATTERN1__', 'description' => '/MIN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 380, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 380 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '49', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MINUTE', 'hashname' => '__PATTERN1__', 'description' => '/MINUTE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 381, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 381 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '50', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MONTH', 'hashname' => '__PATTERN1__', 'description' => '/MONTH/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 382, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 382 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '51', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MULTIPLY_ACT', 'hashname' => '__PATTERN1__', 'description' => '/MULTIPLY_ACT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 383, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 383 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '52', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NODENUMBER', 'hashname' => '__PATTERN1__', 'description' => '/NODENUMBER/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 384, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 384 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '53', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NULLIF', 'hashname' => '__PATTERN1__', 'description' => '/NULLIF/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 385, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 385 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '54', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'PARTITON', 'hashname' => '__PATTERN1__', 'description' => '/PARTITON/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 386, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 386 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '55', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'POSSTR', 'hashname' => '__PATTERN1__', 'description' => '/POSSTR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 387, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 387 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '56', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'RAISE_ERROR', 'hashname' => '__PATTERN1__', 'description' => '/RAISE_ERROR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 388, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 388 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '57', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REAL', 'hashname' => '__PATTERN1__', 'description' => '/REAL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 389, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 389 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '58', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REC2XML', 'hashname' => '__PATTERN1__', 'description' => '/REC2XML/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 390, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 390 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '59', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REGR_AVGX', 'hashname' => '__PATTERN1__', 'description' => '/REGR_AVGX/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 391, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 391 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '60', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REGR_AVGY', 'hashname' => '__PATTERN1__', 'description' => '/REGR_AVGY/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 392, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 392 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '61', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REGR_COUNT', 'hashname' => '__PATTERN1__', 'description' => '/REGR_COUNT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 393, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 393 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '62', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_63_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/REGR_INTERCEPT/i, or /REGR_ICPT/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 394 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 394 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '63', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REGR_R2', 'hashname' => '__PATTERN1__', 'description' => '/REGR_R2/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 395, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 395 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '64', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REGR_SLOPE', 'hashname' => '__PATTERN1__', 'description' => '/REGR_SLOPE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 396, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 396 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '65', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REGR_SXX', 'hashname' => '__PATTERN1__', 'description' => '/REGR_SXX/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 397, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 397 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '66', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REGR_SXY', 'hashname' => '__PATTERN1__', 'description' => '/REGR_SXY/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 398, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 398 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '67', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REGR_SYY', 'hashname' => '__PATTERN1__', 'description' => '/REGR_SYY/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 399, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 399 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '68', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'RTRIM', 'hashname' => '__PATTERN1__', 'description' => '/RTRIM/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 400, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 400 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '69', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SECOND', 'hashname' => '__PATTERN1__', 'description' => '/SECOND/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 401, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 401 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '70', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SMALLINT', 'hashname' => '__PATTERN1__', 'description' => '/SMALLINT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 402, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 402 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '71', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'STDDEV', 'hashname' => '__PATTERN1__', 'description' => '/STDDEV/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 403, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 403 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '72', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SUBSTR', 'hashname' => '__PATTERN1__', 'description' => '/SUBSTR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 404, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 404 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '73', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SUM', 'hashname' => '__PATTERN1__', 'description' => '/SUM/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 405, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 405 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '74', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TABLE_NAME', 'hashname' => '__PATTERN1__', 'description' => '/TABLE_NAME/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 406, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 406 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '75', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TABLE_SCHEMA', 'hashname' => '__PATTERN1__', 'description' => '/TABLE_SCHEMA/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 407, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 407 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '76', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TIME', 'hashname' => '__PATTERN1__', 'description' => '/TIME/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 408, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 408 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '77', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TIMESTAMP', 'hashname' => '__PATTERN1__', 'description' => '/TIMESTAMP/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 409, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 409 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '78', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TRANSLATE', 'hashname' => '__PATTERN1__', 'description' => '/TRANSLATE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 410, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 410 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '79', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TYPE_ID', 'hashname' => '__PATTERN1__', 'description' => '/TYPE_ID/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 411, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 411 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '80', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TYPE_NAME', 'hashname' => '__PATTERN1__', 'description' => '/TYPE_NAME/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 412, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 412 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '81', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TYPE_SCHEMA', 'hashname' => '__PATTERN1__', 'description' => '/TYPE_SCHEMA/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 413, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 413 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '82', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_83_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/UCASE/i, or /UPPER/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 414 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 414 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '83', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'VALUE', 'hashname' => '__PATTERN1__', 'description' => '/VALUE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 415, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 415 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '84', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'VARCHAR', 'hashname' => '__PATTERN1__', 'description' => '/VARCHAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 416, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 416 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '85', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'VARGRAPHIC', 'hashname' => '__PATTERN1__', 'description' => '/VARGRAPHIC/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 417, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 417 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '86', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_87_of_rule_sysibm_function', 'matchrule' => 0, 'implicit' => '/VARIANCE/i, or /VAR/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 418 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 418 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '87', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'YEAR', 'hashname' => '__PATTERN1__', 'description' => '/YEAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 419, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 419 }, 'Parse::RecDescent::Production' ) ], 'name' => 'sysibm_function', 'vars' => '', 'line' => 332 }, 'Parse::RecDescent::Rule' ), 'window_partition_clause' => bless( { 'impcount' => 0, 'calls' => ['partitioning_expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 1, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'op' => [], 'items' => [ bless( { 'pattern' => 'PARTITION\\s+BY', 'hashname' => '__PATTERN1__', 'description' => '/PARTITION\\\\s+BY/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 553, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'expected' => '', 'min' => 1, 'name' => '\'partitioning_expression(s)\'', 'max' => 100000000, 'leftarg' => bless( { 'subrule' => 'partitioning_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 553 }, 'Parse::RecDescent::Subrule' ), 'rightarg' => bless( { 'subrule' => 'partitioning_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 553 }, 'Parse::RecDescent::Subrule' ), 'hashname' => '__DIRECTIVE1__', 'type' => 'leftop', 'op' => bless( { 'pattern' => ',', 'hashname' => '__PATTERN2__', 'description' => '/,/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 553, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) }, 'Parse::RecDescent::Operator' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'window_partition_clause', 'vars' => '', 'line' => 553 }, 'Parse::RecDescent::Rule' ), 'WHERE' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'where', 'hashname' => '__PATTERN1__', 'description' => '/where/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 117, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'WHERE', 'vars' => '', 'line' => 117 }, 'Parse::RecDescent::Rule' ), 'CREATE' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'create', 'hashname' => '__PATTERN1__', 'description' => '/create/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 101, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'CREATE', 'vars' => '', 'line' => 101 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_sysfun' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ABS', 'hashname' => '__PATTERN1__', 'description' => '/ABS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ABSVAL', 'hashname' => '__PATTERN1__', 'description' => '/ABSVAL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_sysfun', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_function' => bless( { 'impcount' => 0, 'calls' => [ 'sysibm_function', 'sysfun_function', 'userdefined_function' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SYSIBM\\.|', 'hashname' => '__PATTERN1__', 'description' => '/SYSIBM\\\\.|/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 625, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'sysibm_function', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 625 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SYSFUN\\.|', 'hashname' => '__PATTERN1__', 'description' => '/SYSFUN\\\\.|/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 626, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'sysfun_function', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 626 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'userdefined_function', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_function', 'vars' => '', 'line' => 625 }, 'Parse::RecDescent::Rule' ), 'identifier' => bless( { 'impcount' => 0, 'calls' => ['NAME'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 136 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'identifier', 'vars' => '', 'line' => 136 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause' => bless( { 'impcount' => 0, 'calls' => [ 'asc_option', 'desc_option' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'asc_option', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'desc_option', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), 'result_expression' => bless( { 'impcount' => 0, 'calls' => ['expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 515 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'result_expression', 'vars' => '', 'line' => 515 }, 'Parse::RecDescent::Rule' ), 'scoped_reference_expression' => bless( { 'impcount' => 0, 'calls' => ['expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 532 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 533, 'code' => '{ # scoped, reference }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'scoped_reference_expression', 'vars' => '', 'line' => 528 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification' => bless( { 'impcount' => 0, 'calls' => [ 'typed_table_name', 'typed_view_name' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'typed_table_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'typed_view_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cast_specification', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), 'when_clause' => bless( { 'impcount' => 0, 'calls' => ['search_condition'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 1, 'items' => [ bless( { 'pattern' => 'WHEN', 'hashname' => '__PATTERN1__', 'description' => '/WHEN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 261, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 261 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'search_condition', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 261 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 261 }, 'Parse::RecDescent::Literal' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 261, 'code' => '{$return = $item[3]}' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'when_clause', 'vars' => '', 'line' => 259 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_asc_option' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NULLS\\s+FIRST', 'hashname' => '__PATTERN1__', 'description' => '/NULLS\\\\s+FIRST/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NULLS\\s+LAST', 'hashname' => '__PATTERN1__', 'description' => '/NULLS\\\\s+LAST/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_asc_option', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'sequence_name' => bless( { 'impcount' => 0, 'calls' => ['NAME'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 615 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'sequence_name', 'vars' => '', 'line' => 615 }, 'Parse::RecDescent::Rule' ), 'ld_duration' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'YEARS?', 'hashname' => '__PATTERN1__', 'description' => '/YEARS?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 488, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MONTHS?', 'hashname' => '__PATTERN1__', 'description' => '/MONTHS?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 489, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 489 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DAYS?', 'hashname' => '__PATTERN1__', 'description' => '/DAYS?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 490, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 490 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '3', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'HOURS?', 'hashname' => '__PATTERN1__', 'description' => '/HOURS?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 491, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 491 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '4', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MINUTES?', 'hashname' => '__PATTERN1__', 'description' => '/MINUTES?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 492, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 492 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '5', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SECONDS?', 'hashname' => '__PATTERN1__', 'description' => '/SECONDS?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 493, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 493 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '6', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MICROSECONDS?', 'hashname' => '__PATTERN1__', 'description' => '/MICROSECONDS?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 494, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 494 }, 'Parse::RecDescent::Production' ) ], 'name' => 'ld_duration', 'vars' => '', 'line' => 488 }, 'Parse::RecDescent::Rule' ), 'reference_a' => bless( { 'impcount' => 0, 'calls' => [ 'old_new_corr', 'old_new_table' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 1, 'items' => [ bless( { 'pattern' => 'REFERENCING', 'hashname' => '__PATTERN1__', 'description' => '/REFERENCING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 283, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'old_new_corr', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 2, 'matchrule' => 0, 'repspec' => '0..2', 'lookahead' => 0, 'line' => 283 }, 'Parse::RecDescent::Repetition' ), bless( { 'subrule' => 'old_new_table', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 2, 'matchrule' => 0, 'repspec' => '0..2', 'lookahead' => 0, 'line' => 283 }, 'Parse::RecDescent::Repetition' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 284, 'code' => '{ $return = join(\' \', $item[1], join(\' \', @{$item[2]}), join(\' \', @{$item[3]}) ) }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'reference_a', 'vars' => '', 'line' => 283 }, 'Parse::RecDescent::Rule' ), 'cast_specification' => bless( { 'impcount' => 2, 'calls' => [ '_alternation_1_of_production_1_of_rule_cast_specification', 'data_type', '_alternation_2_of_production_1_of_rule_cast_specification' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CAST', 'hashname' => '__PATTERN1__', 'description' => '/CAST/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 517, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 517 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_cast_specification', 'matchrule' => 0, 'implicit' => 'expression, or /NULL/i, or parameter_marker', 'argcode' => undef, 'lookahead' => 0, 'line' => 520 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'AS', 'hashname' => '__PATTERN2__', 'description' => '/AS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 520, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'data_type', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 520 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => '_alternation_2_of_production_1_of_rule_cast_specification', 'expected' => '/SCOPE/', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 524 }, 'Parse::RecDescent::Repetition' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 524 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'cast_specification', 'vars' => '', 'line' => 517 }, 'Parse::RecDescent::Rule' ), 'type' => bless( { 'impcount' => 1, 'calls' => [ 'column_name', '_alternation_1_of_production_2_of_rule_type' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 1, 'uncommit' => undef, 'error' => undef, 'patcount' => 3, 'actcount' => 1, 'op' => [], 'items' => [ bless( { 'pattern' => 'UPDATE', 'hashname' => '__PATTERN1__', 'description' => '/UPDATE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 272, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => 'OF', 'hashname' => '__PATTERN2__', 'description' => '/OF/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 272, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'expected' => '', 'min' => 1, 'name' => '\'column_name(s)\'', 'max' => 100000000, 'leftarg' => bless( { 'subrule' => 'column_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 272 }, 'Parse::RecDescent::Subrule' ), 'rightarg' => bless( { 'subrule' => 'column_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 272 }, 'Parse::RecDescent::Subrule' ), 'hashname' => '__DIRECTIVE1__', 'type' => 'leftop', 'op' => bless( { 'pattern' => ',', 'hashname' => '__PATTERN3__', 'description' => '/,/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 272, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) }, 'Parse::RecDescent::Operator' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 273, 'code' => '{ $return = { event => \'update_on\', fields => $item[3] } }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_2_of_rule_type', 'matchrule' => 0, 'implicit' => '/INSERT/i, or /DELETE/i, or /UPDATE/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 277 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 278, 'code' => '{ $return = { event => $item[1] } }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'type', 'vars' => '', 'line' => 272 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_12_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'COVARIANCE', 'hashname' => '__PATTERN1__', 'description' => '/COVARIANCE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'COVAR', 'hashname' => '__PATTERN1__', 'description' => '/COVAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_12_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'scalar_fullselect' => bless( { 'impcount' => 0, 'calls' => ['fullselect'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 478 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'fullselect', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 478 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 478 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'scalar_fullselect', 'vars' => '', 'line' => 478 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_options' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CASCADED', 'hashname' => '__PATTERN1__', 'description' => '/CASCADED/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LOCAL', 'hashname' => '__PATTERN1__', 'description' => '/LOCAL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_options', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'func_args' => bless( { 'impcount' => 0, 'calls' => ['expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 330 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'func_args', 'vars' => '', 'line' => 330 }, 'Parse::RecDescent::Rule' ), 'trigger_name' => bless( { 'impcount' => 0, 'calls' => [ 'SCHEMA', 'NAME' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'SCHEMA', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 119 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => '.', 'hashname' => '__STRING1__', 'description' => '\'.\'', 'lookahead' => 0, 'line' => 119 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 119 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 120, 'code' => '{ $return = { schema => $item[1], name => $item[3] } }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 121 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 122, 'code' => '{ $return = { name => $item[1] } }' }, 'Parse::RecDescent::Action' ) ], 'line' => 121 }, 'Parse::RecDescent::Production' ) ], 'name' => 'trigger_name', 'vars' => '', 'line' => 119 }, 'Parse::RecDescent::Rule' ), '_alternation_2_of_production_1_of_rule_numbering_function' => bless( { 'impcount' => 0, 'calls' => ['window_aggregation_group_clause'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'RANGE\\s+BETWEEN\\s+UNBOUNDED\\s+PRECEDING\\s+AND\\s+UNBBOUNDED\\s+FOLLOWING', 'hashname' => '__PATTERN1__', 'description' => '/RANGE\\\\s+BETWEEN\\\\s+UNBOUNDED\\\\s+PRECEDING\\\\s+AND\\\\s+UNBBOUNDED\\\\s+FOLLOWING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 626, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'window_aggregation_group_clause', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_2_of_production_1_of_rule_numbering_function', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), 'method_name' => bless( { 'impcount' => 0, 'calls' => ['NAME'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 602 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 603, 'code' => '{ # must be a method of subject_expression }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'method_name', 'vars' => '', 'line' => 602 }, 'Parse::RecDescent::Rule' ), 'quantified_p' => bless( { 'impcount' => 0, 'calls' => [ 'expression1', 'fullselect' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'expression1', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => '(=|<>|<|>|<=|=>|\\^=|\\^<|\\^>|\\!=)', 'hashname' => '__PATTERN1__', 'description' => '/(=|<>|<|>|<=|=>|\\\\^=|\\\\^<|\\\\^>|\\\\!=)/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 626, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => 'SOME|ANY|ALL', 'hashname' => '__PATTERN2__', 'description' => '/SOME|ANY|ALL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 626, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'fullselect', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'quantified_p', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), 'common_table_expression' => bless( { 'impcount' => 0, 'calls' => [ 'table_name', 'column_list', 'get_bracketed', 'fullselect' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'table_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 162 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'column_list', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 162 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'AS', 'hashname' => '__PATTERN1__', 'description' => '/AS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 162, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'get_bracketed', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 162 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 163, 'code' => '{ $return = { name => $item{table_name}{name}, query => $item[4] }; }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'table_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 174 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'column_list', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 174 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'AS', 'hashname' => '__PATTERN1__', 'description' => '/AS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 174, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 174 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'fullselect', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 174 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 174 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'common_table_expression', 'vars' => '', 'line' => 160 }, 'Parse::RecDescent::Rule' ), 'after' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'AFTER', 'hashname' => '__PATTERN1__', 'description' => '/AFTER/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 270, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'after', 'vars' => '', 'line' => 270 }, 'Parse::RecDescent::Rule' ), 'predicate' => bless( { 'impcount' => 0, 'calls' => [ 'basic_p', 'quantified_p', 'between_p', 'exists_p', 'in_p', 'like_p', 'null_p', 'type_p' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'basic_p', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 622 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'quantified_p', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 622 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 622 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'between_p', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 622 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 622 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '3', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'exists_p', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 622 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 622 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '4', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'in_p', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 622 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 622 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '5', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'like_p', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 622 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 622 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '6', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'null_p', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 622 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 622 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '7', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'type_p', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 622 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 622 }, 'Parse::RecDescent::Production' ) ], 'name' => 'predicate', 'vars' => '', 'line' => 622 }, 'Parse::RecDescent::Rule' ), 'column_name' => bless( { 'impcount' => 0, 'calls' => ['NAME'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 134 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'column_name', 'vars' => '', 'line' => 134 }, 'Parse::RecDescent::Rule' ), 'method_invocation' => bless( { 'impcount' => 1, 'calls' => [ 'subject_expression', 'method_name', '_alternation_1_of_production_1_of_rule_method_invocation' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'subject_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 593 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => '..', 'hashname' => '__STRING1__', 'description' => '\'..\'', 'lookahead' => 0, 'line' => 593 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'method_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 593 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_method_invocation', 'expected' => '\'(\'', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 596 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'method_invocation', 'vars' => '', 'line' => 593 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_dereference_operation' => bless( { 'impcount' => 0, 'calls' => ['expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'expression', 'expected' => undef, 'min' => 1, 'argcode' => undef, 'max' => 100000000, 'matchrule' => 0, 'repspec' => 's', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Repetition' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_dereference_operation', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_searched_when_clause' => bless( { 'impcount' => 1, 'calls' => [ 'search_condition', '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'WHEN', 'hashname' => '__PATTERN1__', 'description' => '/WHEN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 624, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'search_condition', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 624 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'THEN', 'hashname' => '__PATTERN2__', 'description' => '/THEN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 624, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause', 'matchrule' => 0, 'implicit' => 'result_expression, or /NULL/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_searched_when_clause', 'vars' => '', 'line' => 624 }, 'Parse::RecDescent::Rule' ), 'group_bound2' => bless( { 'impcount' => 0, 'calls' => ['unsigned_constant'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'UNBOUNDED\\s+PRECEDING', 'hashname' => '__PATTERN1__', 'description' => '/UNBOUNDED\\\\s+PRECEDING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 585, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'unsigned_constant', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 586 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'PRECEDING', 'hashname' => '__PATTERN1__', 'description' => '/PRECEDING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 586, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 586 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'unsigned_constant', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 587 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'FOLLOWING', 'hashname' => '__PATTERN1__', 'description' => '/FOLLOWING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 587, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 587 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '3', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CURRENT\\s+ROW', 'hashname' => '__PATTERN1__', 'description' => '/CURRENT\\\\s+ROW/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 588, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 588 }, 'Parse::RecDescent::Production' ) ], 'name' => 'group_bound2', 'vars' => '', 'line' => 585 }, 'Parse::RecDescent::Rule' ), 'searched_when_clause' => bless( { 'impcount' => 1, 'calls' => ['_alternation_1_of_production_1_of_rule_searched_when_clause'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_searched_when_clause', 'expected' => '/WHEN/i', 'min' => 1, 'argcode' => undef, 'max' => 100000000, 'matchrule' => 0, 'repspec' => 's', 'lookahead' => 0, 'line' => 507 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'searched_when_clause', 'vars' => '', 'line' => 503 }, 'Parse::RecDescent::Rule' ), 'basic_p' => bless( { 'impcount' => 0, 'calls' => ['expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 624 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => '(=|<>|<|>|<=|=>|\\^=|\\^<|\\^>|\\!=)', 'hashname' => '__PATTERN1__', 'description' => '/(=|<>|<|>|<=|=>|\\\\^=|\\\\^<|\\\\^>|\\\\!=)/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 624, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 624 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'basic_p', 'vars' => '', 'line' => 624 }, 'Parse::RecDescent::Rule' ), 'asc_option' => bless( { 'impcount' => 1, 'calls' => ['_alternation_1_of_production_1_of_rule_asc_option'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ASC', 'hashname' => '__PATTERN1__', 'description' => '/ASC/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 562, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_asc_option', 'expected' => '/NULLS\\\\s+FIRST/i, or /NULLS\\\\s+LAST/i', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 562 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'asc_option', 'vars' => '', 'line' => 562 }, 'Parse::RecDescent::Rule' ), 'search_condition' => bless( { 'impcount' => 1, 'calls' => [ '_alternation_1_of_production_2_of_rule_search_condition', 'cond' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '[^)]+', 'hashname' => '__PATTERN1__', 'description' => '/[^)]+/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 297, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NOT|', 'hashname' => '__PATTERN1__', 'description' => '/NOT|/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 618, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => '_alternation_1_of_production_2_of_rule_search_condition', 'matchrule' => 0, 'implicit' => 'predicate, or \'(\'', 'argcode' => undef, 'lookahead' => 0, 'line' => 618 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'cond', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 100000000, 'matchrule' => 0, 'repspec' => 's?', 'lookahead' => 0, 'line' => 618 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'search_condition', 'vars' => '', 'line' => 296 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_operator' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CONCAT', 'hashname' => '__PATTERN1__', 'description' => '/CONCAT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '||', 'hashname' => '__STRING1__', 'description' => '\'||\'', 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Literal' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_operator', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'simple_when_clause' => bless( { 'impcount' => 1, 'calls' => [ 'expression', '_alternation_1_of_production_1_of_rule_simple_when_clause' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 509 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_simple_when_clause', 'expected' => '/WHEN/i', 'min' => 1, 'argcode' => undef, 'max' => 100000000, 'matchrule' => 0, 'repspec' => 's', 'lookahead' => 0, 'line' => 513 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'simple_when_clause', 'vars' => '', 'line' => 509 }, 'Parse::RecDescent::Rule' ), 'INNER' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'inner', 'hashname' => '__PATTERN1__', 'description' => '/inner/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 107, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'INNER', 'vars' => '', 'line' => 107 }, 'Parse::RecDescent::Rule' ), 'eofile' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '^\\Z', 'hashname' => '__PATTERN1__', 'description' => '/^\\\\Z/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 20, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'eofile', 'vars' => '', 'line' => 20 }, 'Parse::RecDescent::Rule' ), 'cond' => bless( { 'impcount' => 2, 'calls' => [ '_alternation_1_of_production_1_of_rule_cond', '_alternation_2_of_production_1_of_rule_cond' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_cond', 'matchrule' => 0, 'implicit' => '/AND/i, or /OR/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 620 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'NOT|', 'hashname' => '__PATTERN1__', 'description' => '/NOT|/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 620, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => '_alternation_2_of_production_1_of_rule_cond', 'matchrule' => 0, 'implicit' => 'predicate, or \'(\'', 'argcode' => undef, 'lookahead' => 0, 'line' => 620 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'cond', 'vars' => '', 'line' => 620 }, 'Parse::RecDescent::Rule' ), 'ld_type' => bless( { 'impcount' => 0, 'calls' => [ 'function', 'expression', 'constant', 'column_name', 'host_variable' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'function', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 482 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 483 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 483 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 483 }, 'Parse::RecDescent::Literal' ) ], 'line' => 483 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'constant', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 484 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 484 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '3', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'column_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 485 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 485 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '4', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'host_variable', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 486 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 486 }, 'Parse::RecDescent::Production' ) ], 'name' => 'ld_type', 'vars' => '', 'line' => 482 }, 'Parse::RecDescent::Rule' ), 'RIGHT' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'right', 'hashname' => '__PATTERN1__', 'description' => '/right/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 111, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'RIGHT', 'vars' => '', 'line' => 111 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_method_invocation' => bless( { 'impcount' => 0, 'calls' => ['expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'expression', 'expected' => undef, 'min' => 1, 'argcode' => undef, 'max' => 100000000, 'matchrule' => 0, 'repspec' => 's', 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Repetition' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_method_invocation', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), 'LEFT' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'left', 'hashname' => '__PATTERN1__', 'description' => '/left/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 109, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'LEFT', 'vars' => '', 'line' => 109 }, 'Parse::RecDescent::Rule' ), 'table_name' => bless( { 'impcount' => 0, 'calls' => [ 'SCHEMA', 'NAME' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'SCHEMA', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 124 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => '.', 'hashname' => '__STRING1__', 'description' => '\'.\'', 'lookahead' => 0, 'line' => 124 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 124 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 125, 'code' => '{ $return = { schema => $item[1], name => $item[3] } }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 126 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 127, 'code' => '{ $return = { name => $item[1] } }' }, 'Parse::RecDescent::Action' ) ], 'line' => 126 }, 'Parse::RecDescent::Production' ) ], 'name' => 'table_name', 'vars' => '', 'line' => 124 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_53_of_rule_sysfun' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TRUNCATE', 'hashname' => '__PATTERN1__', 'description' => '/TRUNCATE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TRUNC', 'hashname' => '__PATTERN1__', 'description' => '/TRUNC/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_53_of_rule_sysfun', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'options' => bless( { 'impcount' => 1, 'calls' => ['_alternation_1_of_production_1_of_rule_options'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'WITH', 'hashname' => '__PATTERN1__', 'description' => '/WITH/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 150, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_options', 'matchrule' => 0, 'implicit' => '/CASCADED/i, or /LOCAL/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 150 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'CHECK\\s+OPTION', 'hashname' => '__PATTERN2__', 'description' => '/CHECK\\\\s+OPTION/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 150, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'options', 'vars' => '', 'line' => 150 }, 'Parse::RecDescent::Rule' ), 'function' => bless( { 'impcount' => 1, 'calls' => [ '_alternation_1_of_production_1_of_rule_function', 'func_args' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 2, 'dircount' => 1, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'op' => [], 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_function', 'matchrule' => 0, 'implicit' => '/SYSIBM\\\\.|/i, or /SYSFUN\\\\.|/i, or userdefined_function', 'argcode' => undef, 'lookahead' => 0, 'line' => 326 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 326 }, 'Parse::RecDescent::Literal' ), bless( { 'expected' => '', 'min' => 1, 'name' => '\'func_args(s)\'', 'max' => 100000000, 'leftarg' => bless( { 'subrule' => 'func_args', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 326 }, 'Parse::RecDescent::Subrule' ), 'rightarg' => bless( { 'subrule' => 'func_args', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 326 }, 'Parse::RecDescent::Subrule' ), 'hashname' => '__DIRECTIVE1__', 'type' => 'leftop', 'op' => bless( { 'pattern' => ',', 'hashname' => '__PATTERN1__', 'description' => '/,/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 326, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) }, 'Parse::RecDescent::Operator' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 326 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'function', 'vars' => '', 'line' => 323 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_41_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'INTEGER', 'hashname' => '__PATTERN1__', 'description' => '/INTEGER/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'INT', 'hashname' => '__PATTERN1__', 'description' => '/INT/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_41_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_case_expression' => bless( { 'impcount' => 0, 'calls' => [ 'searched_when_clause', 'simple_when_clause' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'searched_when_clause', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'simple_when_clause', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_case_expression', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_window_order_clause' => bless( { 'impcount' => 1, 'calls' => [ 'sort_key_expression', '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'sort_key_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 624 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_window_order_clause', 'expected' => 'asc_option, or desc_option', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_window_order_clause', 'vars' => '', 'line' => 624 }, 'Parse::RecDescent::Rule' ), 'create' => bless( { 'impcount' => 0, 'calls' => [ 'CREATE', 'TRIGGER', 'trigger_name', 'before', 'type', 'table_name', 'reference_b', 'triggered_action', 'after', 'reference_a', 'VIEW', 'view_name', 'column_list', 'with_expression', 'SQL_procedure_statement' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'CREATE', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 36 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'TRIGGER', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 36 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'trigger_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 36 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'before', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 36 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'type', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 36 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'ON', 'hashname' => '__PATTERN1__', 'description' => '/ON/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 36, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'table_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 36 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'reference_b', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 36 }, 'Parse::RecDescent::Repetition' ), bless( { 'pattern' => 'FOR EACH ROW', 'hashname' => '__PATTERN2__', 'description' => '/FOR EACH ROW/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 36, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => 'MODE DB2SQL', 'hashname' => '__STRING1__', 'description' => '\'MODE DB2SQL\'', 'lookahead' => 0, 'line' => 36 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'triggered_action', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 36 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 37, 'code' => '{ my $table_name = $item{\'table_name\'}{\'name\'}; $return = { table => $table_name, schema => $item{\'trigger_name\'}{\'schema\'}, name => $item{\'trigger_name\'}{\'name\'}, when => \'before\', db_event => $item{\'type\'}->{\'event\'}, fields => $item{\'type\'}{\'fields\'}, condition => $item{\'triggered_action\'}{\'condition\'}, reference => $item{\'reference_b\'}, granularity => $item[9], action => $item{\'triggered_action\'}{\'statement\'} }; push @triggers, $return; }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'CREATE', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 55 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'TRIGGER', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 55 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'trigger_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 55 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'after', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 55 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'type', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 55 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'ON', 'hashname' => '__PATTERN1__', 'description' => '/ON/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 55, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'table_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 55 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'reference_a', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 55 }, 'Parse::RecDescent::Repetition' ), bless( { 'pattern' => 'FOR EACH ROW|FOR EACH STATEMENT', 'hashname' => '__PATTERN2__', 'description' => '/FOR EACH ROW|FOR EACH STATEMENT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 55, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => 'MODE DB2SQL', 'hashname' => '__STRING1__', 'description' => '\'MODE DB2SQL\'', 'lookahead' => 0, 'line' => 55 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'triggered_action', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 55 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 56, 'code' => '{ my $table_name = $item{\'table_name\'}{\'name\'}; $return = { table => $table_name, schema => $item{\'trigger_name\'}{\'schema\'}, name => $item{\'trigger_name\'}{\'name\'}, when => \'after\', db_event => $item{\'type\'}{\'event\'}, fields => $item{\'type\'}{\'fields\'}, condition => $item{\'triggered_action\'}{\'condition\'}, reference => $item{\'reference_a\'}, granularity => $item[9], action => $item{\'triggered_action\'}{\'statement\'} }; push @triggers, $return; }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'CREATE', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 74 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'FEDERATED|', 'hashname' => '__PATTERN1__', 'description' => '/FEDERATED|/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 74, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'VIEW', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 74 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'view_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 74 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'column_list', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 74 }, 'Parse::RecDescent::Repetition' ), bless( { 'pattern' => 'AS', 'hashname' => '__PATTERN2__', 'description' => '/AS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 74, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'with_expression', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 74 }, 'Parse::RecDescent::Repetition' ), bless( { 'subrule' => 'SQL_procedure_statement', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 74 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 75, 'code' => '{ $return = { name => $item{view_name}{name}, sql => $item{SQL_procedure_statement}, with => $item{\'with_expression(?)\'}, fields => $item{\'column_list(?)\'} }; push @views, $return; }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'create', 'vars' => '', 'line' => 36 }, 'Parse::RecDescent::Rule' ), 'sysfun' => bless( { 'impcount' => 0, 'calls' => [ '_alternation_1_of_production_1_of_rule_sysfun', '_alternation_1_of_production_7_of_rule_sysfun', 'I', '_alternation_1_of_production_53_of_rule_sysfun' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_sysfun', 'matchrule' => 0, 'implicit' => '/ABS/i, or /ABSVAL/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 421 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ACOS', 'hashname' => '__PATTERN1__', 'description' => '/ACOS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 422, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 422 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ASCII', 'hashname' => '__PATTERN1__', 'description' => '/ASCII/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 423, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 423 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '3', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ASIN', 'hashname' => '__PATTERN1__', 'description' => '/ASIN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 424, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 424 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '4', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ATAN', 'hashname' => '__PATTERN1__', 'description' => '/ATAN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 425, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 425 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '5', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ATAN2', 'hashname' => '__PATTERN1__', 'description' => '/ATAN2/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 426, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 426 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '6', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_7_of_rule_sysfun', 'matchrule' => 0, 'implicit' => '/CEIL/i, or /CEILING/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 427 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 427 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '7', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CHAR', 'hashname' => '__PATTERN1__', 'description' => '/CHAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 428, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 428 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '8', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CHR', 'hashname' => '__PATTERN1__', 'description' => '/CHR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 429, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 429 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '9', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'COS', 'hashname' => '__PATTERN1__', 'description' => '/COS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 430, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 430 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '10', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'COT', 'hashname' => '__PATTERN1__', 'description' => '/COT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 431, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 431 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '11', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DAYNAME', 'hashname' => '__PATTERN1__', 'description' => '/DAYNAME/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 432, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 432 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '12', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DAYOFWEEK', 'hashname' => '__PATTERN1__', 'description' => '/DAYOFWEEK/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 433, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 433 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '13', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DAYOFWEEK_ISO', 'hashname' => '__PATTERN1__', 'description' => '/DAYOFWEEK_ISO/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 434, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 434 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '14', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DAYOFYEAR', 'hashname' => '__PATTERN1__', 'description' => '/DAYOFYEAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 435, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 435 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '15', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DEGREES', 'hashname' => '__PATTERN1__', 'description' => '/DEGREES/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 436, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 436 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '16', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DIFFERENCE', 'hashname' => '__PATTERN1__', 'description' => '/DIFFERENCE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 437, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 437 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '17', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DOUBLE', 'hashname' => '__PATTERN1__', 'description' => '/DOUBLE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 438, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 438 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '18', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'EXP', 'hashname' => '__PATTERN1__', 'description' => '/EXP/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 439, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 439 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '19', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'FLOOR', 'hashname' => '__PATTERN1__', 'description' => '/FLOOR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 440, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 440 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '20', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'GET_ROUTINE_SAR', 'hashname' => '__PATTERN1__', 'description' => '/GET_ROUTINE_SAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 441, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 441 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '21', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'INSERT', 'hashname' => '__PATTERN1__', 'description' => '/INSERT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 442, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 442 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '22', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'JULIAN_DAY', 'hashname' => '__PATTERN1__', 'description' => '/JULIAN_DAY/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 443, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 443 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '23', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LCASE', 'hashname' => '__PATTERN1__', 'description' => '/LCASE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 444, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 444 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '24', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LEFT', 'hashname' => '__PATTERN1__', 'description' => '/LEFT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 445, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 445 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '25', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LN', 'hashname' => '__PATTERN1__', 'description' => '/LN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 446, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 446 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '26', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LOCATE', 'hashname' => '__PATTERN1__', 'description' => '/LOCATE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 447, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 447 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '27', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LOG', 'hashname' => '__PATTERN1__', 'description' => '/LOG/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 448, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 448 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '28', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LOG10', 'hashname' => '__PATTERN1__', 'description' => '/LOG10/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 449, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 449 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '29', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LTRIM', 'hashname' => '__PATTERN1__', 'description' => '/LTRIM/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 450, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 450 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '30', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MIDNIGHT_SECONDS', 'hashname' => '__PATTERN1__', 'description' => '/MIDNIGHT_SECONDS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 451, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 451 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '31', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MOD', 'hashname' => '__PATTERN1__', 'description' => '/MOD/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 452, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 452 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '32', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'MONTHNAME', 'hashname' => '__PATTERN1__', 'description' => '/MONTHNAME/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 453, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 453 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '33', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'POWER', 'hashname' => '__PATTERN1__', 'description' => '/POWER/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 454, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 454 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '34', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'PUT_ROUTINE_SAR', 'hashname' => '__PATTERN1__', 'description' => '/PUT_ROUTINE_SAR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 455, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 455 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '35', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'QUARTER', 'hashname' => '__PATTERN1__', 'description' => '/QUARTER/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 456, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 456 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '36', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'RADIANS', 'hashname' => '__PATTERN1__', 'description' => '/RADIANS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 457, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 457 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '37', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'RAND', 'hashname' => '__PATTERN1__', 'description' => '/RAND/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 458, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 458 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '38', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REPEAT', 'hashname' => '__PATTERN1__', 'description' => '/REPEAT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 459, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 459 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '39', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REPLACE', 'hashname' => '__PATTERN1__', 'description' => '/REPLACE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 460, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 460 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '40', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'RIGHT', 'hashname' => '__PATTERN1__', 'description' => '/RIGHT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 461, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 461 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '41', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ROUND', 'hashname' => '__PATTERN1__', 'description' => '/ROUND/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 462, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 462 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '42', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'RTRIM', 'hashname' => '__PATTERN1__', 'description' => '/RTRIM/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 463, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'I', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 463 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 463 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '43', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SIGN', 'hashname' => '__PATTERN1__', 'description' => '/SIGN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 464, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 464 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '44', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SIN', 'hashname' => '__PATTERN1__', 'description' => '/SIN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 465, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 465 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '45', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SOUNDEX', 'hashname' => '__PATTERN1__', 'description' => '/SOUNDEX/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 466, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 466 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '46', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SPACE', 'hashname' => '__PATTERN1__', 'description' => '/SPACE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 467, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 467 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '47', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SQLCACHE_SNAPSHOT', 'hashname' => '__PATTERN1__', 'description' => '/SQLCACHE_SNAPSHOT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 468, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 468 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '48', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SQRT', 'hashname' => '__PATTERN1__', 'description' => '/SQRT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 469, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 469 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '49', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TAN', 'hashname' => '__PATTERN1__', 'description' => '/TAN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 470, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 470 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '50', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TIMESTAMP_ISO', 'hashname' => '__PATTERN1__', 'description' => '/TIMESTAMP_ISO/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 471, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 471 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '51', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TIMESTAMPDIFF', 'hashname' => '__PATTERN1__', 'description' => '/TIMESTAMPDIFF/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 472, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 472 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '52', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_53_of_rule_sysfun', 'matchrule' => 0, 'implicit' => '/TRUNCATE/i, or /TRUNC/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 473 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 473 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '53', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'UCASE', 'hashname' => '__PATTERN1__', 'description' => '/UCASE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 474, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 474 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '54', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'WEEK', 'hashname' => '__PATTERN1__', 'description' => '/WEEK/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 475, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 475 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '55', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'WEEK_ISO', 'hashname' => '__PATTERN1__', 'description' => '/WEEK_ISO/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 476, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 476 }, 'Parse::RecDescent::Production' ) ], 'name' => 'sysfun', 'vars' => '', 'line' => 421 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond' => bless( { 'impcount' => 0, 'calls' => ['numeric_constant'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SELECTIVITY', 'hashname' => '__PATTERN1__', 'description' => '/SELECTIVITY/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'numeric_constant', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule__alternation_2_of_production_1_of_rule_cond', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'NAME' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '\\w+', 'hashname' => '__PATTERN1__', 'description' => '/\\\\w+/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 146, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '\\w{1,18}', 'hashname' => '__PATTERN1__', 'description' => '/\\\\w\\{1,18\\}/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 148, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'NAME', 'vars' => '', 'line' => 146 }, 'Parse::RecDescent::Rule' ), 'constant' => bless( { 'impcount' => 0, 'calls' => [ 'int_const', 'float_const', 'dec_const', 'char_const', 'hex_const', 'grastr_const' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'int_const', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 328 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'float_const', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 328 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 328 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'dec_const', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 328 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 328 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '3', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'char_const', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 328 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 328 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '4', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'hex_const', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 328 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 328 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '5', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'grastr_const', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 328 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 328 }, 'Parse::RecDescent::Production' ) ], 'name' => 'constant', 'vars' => '', 'line' => 328 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_ranking_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'RANK', 'hashname' => '__PATTERN1__', 'description' => '/RANK/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 626, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '()', 'hashname' => '__STRING1__', 'description' => '\'()\'', 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DENSE_RANK|DENSERANK', 'hashname' => '__PATTERN1__', 'description' => '/DENSE_RANK|DENSERANK/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 627, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '()', 'hashname' => '__STRING1__', 'description' => '\'()\'', 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Literal' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_ranking_function', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), 'window_aggregation_group_clause' => bless( { 'impcount' => 2, 'calls' => [ '_alternation_1_of_production_1_of_rule_window_aggregation_group_clause', '_alternation_2_of_production_1_of_rule_window_aggregation_group_clause' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_window_aggregation_group_clause', 'matchrule' => 0, 'implicit' => '/ROWS/i, or /RANGE/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 568 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => '_alternation_2_of_production_1_of_rule_window_aggregation_group_clause', 'matchrule' => 0, 'implicit' => 'group_start, or group_between, or group_end', 'argcode' => undef, 'lookahead' => 0, 'line' => 572 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'window_aggregation_group_clause', 'vars' => '', 'line' => 566 }, 'Parse::RecDescent::Rule' ), '_alternation_2_of_production_1_of_rule_window_aggregation_group_clause' => bless( { 'impcount' => 0, 'calls' => [ 'group_start', 'group_between', 'group_end' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'group_start', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 625 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'group_between', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 626 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'group_end', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_2_of_production_1_of_rule_window_aggregation_group_clause', 'vars' => '', 'line' => 625 }, 'Parse::RecDescent::Rule' ), 'VIEW' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'view', 'hashname' => '__PATTERN1__', 'description' => '/view/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 105, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'VIEW', 'vars' => '', 'line' => 105 }, 'Parse::RecDescent::Rule' ), 'with_expression' => bless( { 'impcount' => 0, 'calls' => ['common_table_expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 1, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 1, 'op' => [], 'items' => [ bless( { 'pattern' => 'WITH', 'hashname' => '__PATTERN1__', 'description' => '/WITH/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 89, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'expected' => '', 'min' => 1, 'name' => '\'common_table_expression(s)\'', 'max' => 100000000, 'leftarg' => bless( { 'subrule' => 'common_table_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 89 }, 'Parse::RecDescent::Subrule' ), 'rightarg' => bless( { 'subrule' => 'common_table_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 89 }, 'Parse::RecDescent::Subrule' ), 'hashname' => '__DIRECTIVE1__', 'type' => 'leftop', 'op' => bless( { 'pattern' => ',', 'hashname' => '__PATTERN2__', 'description' => '/,/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 89, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) }, 'Parse::RecDescent::Operator' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 90, 'code' => '{ $return = $item{\'common_table_expression\'}; }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'with_expression', 'vars' => '', 'line' => 87 }, 'Parse::RecDescent::Rule' ), 'numeric_constant' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '\\d+', 'hashname' => '__PATTERN1__', 'description' => '/\\\\d+/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 140, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'numeric_constant', 'vars' => '', 'line' => 140 }, 'Parse::RecDescent::Rule' ), 'old_new_table' => bless( { 'impcount' => 0, 'calls' => ['identifier'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 1, 'items' => [ bless( { 'pattern' => 'OLD_TABLE', 'hashname' => '__PATTERN1__', 'description' => '/OLD_TABLE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 291, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(AS)?', 'hashname' => '__PATTERN2__', 'description' => '/(AS)?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 291, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'identifier', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 291 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 292, 'code' => '{ $return = join(\' \', @item[1..3] ) }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 1, 'items' => [ bless( { 'pattern' => 'NEW_TABLE', 'hashname' => '__PATTERN1__', 'description' => '/NEW_TABLE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 293, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(AS)?', 'hashname' => '__PATTERN2__', 'description' => '/(AS)?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 293, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'identifier', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 293 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 294, 'code' => '{ $return = join(\' \', @item[1..3] ) }' }, 'Parse::RecDescent::Action' ) ], 'line' => 293 }, 'Parse::RecDescent::Production' ) ], 'name' => 'old_new_table', 'vars' => '', 'line' => 291 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_numbering_function' => bless( { 'impcount' => 0, 'calls' => [ 'window_order_clause', 'window_aggregation_group_clause' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'window_order_clause', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'window_aggregation_group_clause', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_numbering_function', 'vars' => '', 'line' => 627 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause' => bless( { 'impcount' => 0, 'calls' => ['result_expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'result_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NULL', 'hashname' => '__PATTERN1__', 'description' => '/NULL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 627, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_searched_when_clause', 'vars' => '', 'line' => 626 }, 'Parse::RecDescent::Rule' ), 'old_new_corr' => bless( { 'impcount' => 0, 'calls' => ['correlation_name'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 1, 'items' => [ bless( { 'pattern' => 'OLD', 'hashname' => '__PATTERN1__', 'description' => '/OLD/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 286, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(AS)?', 'hashname' => '__PATTERN2__', 'description' => '/(AS)?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 286, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'correlation_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 286 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 287, 'code' => '{ $return = join(\' \', @item[1..3] ) }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 1, 'items' => [ bless( { 'pattern' => 'NEW', 'hashname' => '__PATTERN1__', 'description' => '/NEW/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 288, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(AS)?', 'hashname' => '__PATTERN2__', 'description' => '/(AS)?/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 288, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'correlation_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 288 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 289, 'code' => '{ $return = join(\' \', @item[1..3] ) }' }, 'Parse::RecDescent::Action' ) ], 'line' => 288 }, 'Parse::RecDescent::Production' ) ], 'name' => 'old_new_corr', 'vars' => '', 'line' => 286 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_42_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LCASE', 'hashname' => '__PATTERN1__', 'description' => '/LCASE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'LOWER', 'hashname' => '__PATTERN1__', 'description' => '/LOWER/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_42_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'subtype_treatment' => bless( { 'impcount' => 0, 'calls' => [ 'expression', 'data_type' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'TREAT', 'hashname' => '__PATTERN1__', 'description' => '/TREAT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 606, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 606 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 606 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'AS', 'hashname' => '__PATTERN2__', 'description' => '/AS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 606, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'data_type', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 606 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 606 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'subtype_treatment', 'vars' => '', 'line' => 606 }, 'Parse::RecDescent::Rule' ), 'expression' => bless( { 'impcount' => 1, 'calls' => ['_alternation_1_of_production_1_of_rule_expression'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 1, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'op' => [], 'items' => [ bless( { 'expected' => '', 'min' => 1, 'name' => '\'_alternation_1_of_production_1_of_rule_expression(s)\'', 'max' => 100000000, 'leftarg' => bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_expression', 'matchrule' => 0, 'implicit' => '\'+\', or \'-\'', 'argcode' => undef, 'lookahead' => 0, 'line' => 319 }, 'Parse::RecDescent::Subrule' ), 'rightarg' => bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_expression', 'matchrule' => 0, 'implicit' => '\'+\', or \'-\'', 'argcode' => undef, 'lookahead' => 0, 'line' => 319 }, 'Parse::RecDescent::Subrule' ), 'hashname' => '__DIRECTIVE1__', 'type' => 'leftop', 'op' => bless( { 'pattern' => 'operator', 'hashname' => '__PATTERN1__', 'description' => '/operator/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 319, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) }, 'Parse::RecDescent::Operator' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'expression', 'vars' => '', 'line' => 299 }, 'Parse::RecDescent::Rule' ), '_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression' => bless( { 'impcount' => 0, 'calls' => [ 'function', 'expression', 'constant', 'column_name', 'host_variable', 'special_register', 'scalar_fullselect', 'labeled_duration', 'case_expression', 'cast_specification', 'OLAP_function', 'method_invocation', 'subtype_treatment', 'sequence_reference' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'function', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 613 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 614 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 614 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 614 }, 'Parse::RecDescent::Literal' ) ], 'line' => 614 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'constant', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 615 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 615 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '3', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'column_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 616 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 616 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '4', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'host_variable', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 617 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 617 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '5', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'special_register', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 618 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 618 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '6', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 619 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'scalar_fullselect', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 619 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 619 }, 'Parse::RecDescent::Literal' ) ], 'line' => 619 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '7', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'labeled_duration', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 620 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 620 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '8', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'case_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 621 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 621 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '9', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'cast_specification', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 622 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 622 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '10', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'OLAP_function', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 624 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 623 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '11', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'method_invocation', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 625 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 625 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '12', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'subtype_treatment', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 626 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 626 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '13', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'sequence_reference', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_2_of_production_1_of_rule__alternation_1_of_production_1_of_rule_expression', 'vars' => '', 'line' => 613 }, 'Parse::RecDescent::Rule' ), 'startrule' => bless( { 'impcount' => 0, 'calls' => [ 'statement', 'eofile' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 1, 'items' => [ bless( { 'subrule' => 'statement', 'expected' => undef, 'min' => 1, 'argcode' => undef, 'max' => 100000000, 'matchrule' => 0, 'repspec' => 's', 'lookahead' => 0, 'line' => 12 }, 'Parse::RecDescent::Repetition' ), bless( { 'subrule' => 'eofile', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 12 }, 'Parse::RecDescent::Subrule' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 12, 'code' => '{ $return = { tables => \\%tables, views => \\@views, triggers => \\@triggers, } }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'startrule', 'vars' => '', 'line' => 11 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_cast_specification' => bless( { 'impcount' => 0, 'calls' => [ 'expression', 'parameter_marker' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 625 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NULL', 'hashname' => '__PATTERN1__', 'description' => '/NULL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 626, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 626 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'parameter_marker', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => 627 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_cast_specification', 'vars' => '', 'line' => 625 }, 'Parse::RecDescent::Rule' ), 'before' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NO CASCADE BEFORE', 'hashname' => '__PATTERN1__', 'description' => '/NO CASCADE BEFORE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 268, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'before', 'vars' => '', 'line' => 268 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_83_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'UCASE', 'hashname' => '__PATTERN1__', 'description' => '/UCASE/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'UPPER', 'hashname' => '__PATTERN1__', 'description' => '/UPPER/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_83_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'ranking_function' => bless( { 'impcount' => 1, 'calls' => [ '_alternation_1_of_production_1_of_rule_ranking_function', 'window_partition_clause', 'window_order_clause' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 2, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_ranking_function', 'matchrule' => 0, 'implicit' => '/RANK/, or /DENSE_RANK|DENSERANK/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 544 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'OVER', 'hashname' => '__PATTERN1__', 'description' => '/OVER/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 544, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 544 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'window_partition_clause', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 544 }, 'Parse::RecDescent::Repetition' ), bless( { 'subrule' => 'window_order_clause', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 544 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 544 }, 'Parse::RecDescent::Literal' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'ranking_function', 'vars' => '', 'line' => 542 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition' => bless( { 'impcount' => 0, 'calls' => ['numeric_constant'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'SELECTIVITY', 'hashname' => '__PATTERN1__', 'description' => '/SELECTIVITY/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'numeric_constant', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 628 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_2_of_rule_search_condition', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ABS', 'hashname' => '__PATTERN1__', 'description' => '/ABS/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'ABSVAL', 'hashname' => '__PATTERN1__', 'description' => '/ABSVAL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'reference_b' => bless( { 'impcount' => 0, 'calls' => ['old_new_corr'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 1, 'items' => [ bless( { 'pattern' => 'REFERENCING', 'hashname' => '__PATTERN1__', 'description' => '/REFERENCING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 280, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'old_new_corr', 'expected' => undef, 'min' => 0, 'argcode' => undef, 'max' => 2, 'matchrule' => 0, 'repspec' => '0..2', 'lookahead' => 0, 'line' => 280 }, 'Parse::RecDescent::Repetition' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 281, 'code' => '{ $return = join(\' \', $item[1], join(\' \', @{$item[2]}) ) }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'reference_b', 'vars' => '', 'line' => 280 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_1_of_rule_simple_when_clause' => bless( { 'impcount' => 1, 'calls' => [ 'search_condition', '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'WHEN', 'hashname' => '__PATTERN1__', 'description' => '/WHEN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 624, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'search_condition', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 624 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'THEN', 'hashname' => '__PATTERN2__', 'description' => '/THEN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 624, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule__alternation_1_of_production_1_of_rule_simple_when_clause', 'matchrule' => 0, 'implicit' => 'result_expression, or /NULL/i', 'argcode' => undef, 'lookahead' => 0, 'line' => 627 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_1_of_rule_simple_when_clause', 'vars' => '', 'line' => 624 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_9_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CORRELATION', 'hashname' => '__PATTERN1__', 'description' => '/CORRELATION/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CORR', 'hashname' => '__PATTERN1__', 'description' => '/CORR/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_9_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_7_of_rule_sysfun' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CEIL', 'hashname' => '__PATTERN1__', 'description' => '/CEIL/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CEILING', 'hashname' => '__PATTERN1__', 'description' => '/CEILING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_7_of_rule_sysfun', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'prevval_expression' => bless( { 'impcount' => 0, 'calls' => ['sequence_name'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'PREVVAL\\s+FOR', 'hashname' => '__PATTERN1__', 'description' => '/PREVVAL\\\\s+FOR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 613, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'sequence_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 613 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'prevval_expression', 'vars' => '', 'line' => 613 }, 'Parse::RecDescent::Rule' ), 'where_clause' => bless( { 'impcount' => 0, 'calls' => [ 'WHERE', 'search_condition' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'WHERE', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 218 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => 'search_condition', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 218 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'where_clause', 'vars' => '', 'line' => 216 }, 'Parse::RecDescent::Rule' ), 'group_start' => bless( { 'impcount' => 0, 'calls' => ['unsigned_constant'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'UNBOUNDED\\s+PRECEDING', 'hashname' => '__PATTERN1__', 'description' => '/UNBOUNDED\\\\s+PRECEDING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 574, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'unsigned_constant', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 575 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'PRECEDING', 'hashname' => '__PATTERN1__', 'description' => '/PRECEDING/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 575, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 575 }, 'Parse::RecDescent::Production' ), bless( { 'number' => '2', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'CURRENT\\s+ROW', 'hashname' => '__PATTERN1__', 'description' => '/CURRENT\\\\s+ROW/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 576, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 576 }, 'Parse::RecDescent::Production' ) ], 'name' => 'group_start', 'vars' => '', 'line' => 574 }, 'Parse::RecDescent::Rule' ), 'correlation_name' => bless( { 'impcount' => 0, 'calls' => ['NAME'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'NAME', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 138 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'correlation_name', 'vars' => '', 'line' => 138 }, 'Parse::RecDescent::Rule' ), 'SQL_procedure_statement' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 1, 'items' => [ bless( { 'pattern' => '[^;]*', 'hashname' => '__PATTERN1__', 'description' => '/[^;]*/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 94, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'pattern' => '(;|\\z)', 'hashname' => '__PATTERN2__', 'description' => '/(;|\\\\z)/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 94, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 94, 'code' => '{ $return = $item[1] . $item[2] }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'SQL_procedure_statement', 'vars' => '', 'line' => 94 }, 'Parse::RecDescent::Rule' ), 'group_between' => bless( { 'impcount' => 0, 'calls' => [ 'group_bound1', 'group_bound2' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'BETWEEN', 'hashname' => '__PATTERN1__', 'description' => '/BETWEEN/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 578, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'group_bound1', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 578 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => 'AND', 'hashname' => '__PATTERN2__', 'description' => '/AND/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 578, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'group_bound2', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 578 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'group_between', 'vars' => '', 'line' => 578 }, 'Parse::RecDescent::Rule' ), 'nextval_expression' => bless( { 'impcount' => 0, 'calls' => ['sequence_name'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'NEXTVAL\\s+FOR', 'hashname' => '__PATTERN1__', 'description' => '/NEXTVAL\\\\s+FOR/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 611, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => 'sequence_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 611 }, 'Parse::RecDescent::Subrule' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'nextval_expression', 'vars' => '', 'line' => 611 }, 'Parse::RecDescent::Rule' ), 'desc_option' => bless( { 'impcount' => 1, 'calls' => ['_alternation_1_of_production_1_of_rule_desc_option'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'DESC', 'hashname' => '__PATTERN1__', 'description' => '/DESC/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 564, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_desc_option', 'expected' => '/NULLS\\\\s+FIRST/i, or /NULLS\\\\s+LAST/i', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 564 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'desc_option', 'vars' => '', 'line' => 564 }, 'Parse::RecDescent::Rule' ), 'column_list' => bless( { 'impcount' => 0, 'calls' => ['column_name'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 2, 'dircount' => 1, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 1, 'op' => [], 'items' => [ bless( { 'pattern' => '(', 'hashname' => '__STRING1__', 'description' => '\'(\'', 'lookahead' => 0, 'line' => 96 }, 'Parse::RecDescent::Literal' ), bless( { 'expected' => '', 'min' => 1, 'name' => '\'column_name(s)\'', 'max' => 100000000, 'leftarg' => bless( { 'subrule' => 'column_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 96 }, 'Parse::RecDescent::Subrule' ), 'rightarg' => bless( { 'subrule' => 'column_name', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 96 }, 'Parse::RecDescent::Subrule' ), 'hashname' => '__DIRECTIVE1__', 'type' => 'leftop', 'op' => bless( { 'pattern' => ',', 'hashname' => '__PATTERN1__', 'description' => '/,/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 96, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) }, 'Parse::RecDescent::Operator' ), bless( { 'pattern' => ')', 'hashname' => '__STRING2__', 'description' => '\')\'', 'lookahead' => 0, 'line' => 96 }, 'Parse::RecDescent::Literal' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 97, 'code' => '{ $return = join(\' \', \'(\', @{$item[2]}, \')\'); }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'column_list', 'vars' => '', 'line' => 96 }, 'Parse::RecDescent::Rule' ), '_alternation_1_of_production_63_of_rule_sysibm_function' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REGR_INTERCEPT', 'hashname' => '__PATTERN1__', 'description' => '/REGR_INTERCEPT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ), bless( { 'number' => '1', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'REGR_ICPT', 'hashname' => '__PATTERN1__', 'description' => '/REGR_ICPT/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 628, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => 628 }, 'Parse::RecDescent::Production' ) ], 'name' => '_alternation_1_of_production_63_of_rule_sysibm_function', 'vars' => '', 'line' => 628 }, 'Parse::RecDescent::Rule' ), 'dereference_operation' => bless( { 'impcount' => 1, 'calls' => [ 'scoped_reference_expression', 'name1', '_alternation_1_of_production_1_of_rule_dereference_operation' ], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 1, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 0, 'actcount' => 0, 'items' => [ bless( { 'subrule' => 'scoped_reference_expression', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 526 }, 'Parse::RecDescent::Subrule' ), bless( { 'pattern' => '->', 'hashname' => '__STRING1__', 'description' => '\'->\'', 'lookahead' => 0, 'line' => 526 }, 'Parse::RecDescent::Literal' ), bless( { 'subrule' => 'name1', 'matchrule' => 0, 'implicit' => undef, 'argcode' => undef, 'lookahead' => 0, 'line' => 526 }, 'Parse::RecDescent::Subrule' ), bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_dereference_operation', 'expected' => '\'(\'', 'min' => 0, 'argcode' => undef, 'max' => 1, 'matchrule' => 0, 'repspec' => '?', 'lookahead' => 0, 'line' => 527 }, 'Parse::RecDescent::Repetition' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'dereference_operation', 'vars' => '', 'line' => 526 }, 'Parse::RecDescent::Rule' ), 'OUTER' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'outer', 'hashname' => '__PATTERN1__', 'description' => '/outer/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 115, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'OUTER', 'vars' => '', 'line' => 115 }, 'Parse::RecDescent::Rule' ), 'window_order_clause' => bless( { 'impcount' => 1, 'calls' => ['_alternation_1_of_production_1_of_rule_window_order_clause'], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 1, 'uncommit' => undef, 'error' => undef, 'patcount' => 2, 'actcount' => 0, 'op' => [], 'items' => [ bless( { 'pattern' => 'ORDER\\s+BY', 'hashname' => '__PATTERN1__', 'description' => '/ORDER\\\\s+BY/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 555, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'expected' => '', 'min' => 1, 'name' => '\'_alternation_1_of_production_1_of_rule_window_order_clause(s)\'', 'max' => 100000000, 'leftarg' => bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_window_order_clause', 'matchrule' => 0, 'implicit' => 'sort_key_expression', 'argcode' => undef, 'lookahead' => 0, 'line' => 560 }, 'Parse::RecDescent::Subrule' ), 'rightarg' => bless( { 'subrule' => '_alternation_1_of_production_1_of_rule_window_order_clause', 'matchrule' => 0, 'implicit' => 'sort_key_expression', 'argcode' => undef, 'lookahead' => 0, 'line' => 560 }, 'Parse::RecDescent::Subrule' ), 'hashname' => '__DIRECTIVE1__', 'type' => 'leftop', 'op' => bless( { 'pattern' => ',', 'hashname' => '__PATTERN2__', 'description' => '/,/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 560, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) }, 'Parse::RecDescent::Operator' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'window_order_clause', 'vars' => '', 'line' => 555 }, 'Parse::RecDescent::Rule' ), 'TRIGGER' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 0, 'items' => [ bless( { 'pattern' => 'trigger', 'hashname' => '__PATTERN1__', 'description' => '/trigger/i', 'lookahead' => 0, 'rdelim' => '/', 'line' => 103, 'mod' => 'i', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'TRIGGER', 'vars' => '', 'line' => 103 }, 'Parse::RecDescent::Rule' ), 'comment' => bless( { 'impcount' => 0, 'calls' => [], 'changed' => 0, 'opcount' => 0, 'prods' => [ bless( { 'number' => '0', 'strcount' => 0, 'dircount' => 0, 'uncommit' => undef, 'error' => undef, 'patcount' => 1, 'actcount' => 1, 'items' => [ bless( { 'pattern' => '^\\s*-{2}.*\\n', 'hashname' => '__PATTERN1__', 'description' => '/^\\\\s*-\\{2\\}.*\\\\n/', 'lookahead' => 0, 'rdelim' => '/', 'line' => 27, 'mod' => '', 'ldelim' => '/' }, 'Parse::RecDescent::Token' ), bless( { 'hashname' => '__ACTION1__', 'lookahead' => 0, 'line' => 28, 'code' => '{ my $comment = $item[1]; $comment =~ s/^\\s*(-{2})\\s*//; $comment =~ s/\\s*$//; $return = $comment; }' }, 'Parse::RecDescent::Action' ) ], 'line' => undef }, 'Parse::RecDescent::Production' ) ], 'name' => 'comment', 'vars' => '', 'line' => 27 }, 'Parse::RecDescent::Rule' ) } }, 'Parse::RecDescent' ); } SQL-Translator-1.66/lib/SQL/Translator/Parser/xSV.pm0000644000000000000000000001017014716630117022107 0ustar00rootroot00000000000000package SQL::Translator::Parser::xSV; =head1 NAME SQL::Translator::Parser::xSV - parser for arbitrarily delimited text files =head1 SYNOPSIS use SQL::Translator; use SQL::Translator::Parser::xSV; my $translator = SQL::Translator->new( parser => 'xSV', parser_args => { field_separator => "\t" }, ); =head1 DESCRIPTION Parses arbitrarily delimited text files. See the Text::RecordParser manpage for arguments on how to parse the file (e.g., C, C). Other arguments include: =head1 OPTIONS =over =item * scan_fields Indicates that the columns should be scanned to determine data types and field sizes. True by default. =item * trim_fields A shortcut to sending filters to Text::RecordParser, will create callbacks that trim leading and trailing spaces from fields and headers. True by default. =back Field names will automatically be normalized by C. =cut use strict; use warnings; our @EXPORT; our $VERSION = '1.66'; use Exporter; use Text::ParseWords qw(quotewords); use Text::RecordParser; use SQL::Translator::Utils qw(debug normalize_name); use base qw(Exporter); @EXPORT = qw(parse); # # Passed a SQL::Translator instance and a string containing the data # sub parse { my ($tr, $data) = @_; my $args = $tr->parser_args; my $parser = Text::RecordParser->new( field_separator => $args->{'field_separator'} || ',', record_separator => $args->{'record_separator'} || "\n", data => $data, header_filter => \&normalize_name, ); $parser->field_filter(sub { $_ = shift || ''; s/^\s+|\s+$//g; $_ }) unless defined $args->{'trim_fields'} && $args->{'trim_fields'} == 0; my $schema = $tr->schema; my $table = $schema->add_table(name => 'table1'); # # Get the field names from the first row. # $parser->bind_header; my @field_names = $parser->field_list; for (my $i = 0; $i < @field_names; $i++) { my $field = $table->add_field( name => $field_names[$i], data_type => 'char', default_value => '', size => 255, is_nullable => 1, is_auto_increment => undef, ) or die $table->error; if ($i == 0) { $table->primary_key($field->name); $field->is_primary_key(1); } } # # If directed, look at every field's values to guess size and type. # unless (defined $args->{'scan_fields'} && $args->{'scan_fields'} == 0) { my %field_info = map { $_, {} } @field_names; while (my $rec = $parser->fetchrow_hashref) { for my $field (@field_names) { my $data = defined $rec->{$field} ? $rec->{$field} : ''; my $size = [ length $data ]; my $type; if ($data =~ /^-?\d+$/) { $type = 'integer'; } elsif ($data =~ /^-?[,\d]+\.[\d+]?$/ || $data =~ /^-?[,\d]+?\.\d+$/ || $data =~ /^-?\.\d+$/) { $type = 'float'; my ($w, $d) = map { s/,//g; length $_ || 1 } split(/\./, $data); $size = [ $w + $d, $d ]; } else { $type = 'char'; } for my $i (0, 1) { next unless defined $size->[$i]; my $fsize = $field_info{$field}{'size'}[$i] || 0; if ($size->[$i] > $fsize) { $field_info{$field}{'size'}[$i] = $size->[$i]; } } $field_info{$field}{$type}++; } } for my $field (keys %field_info) { my $size = $field_info{$field}{'size'} || [1]; my $data_type = $field_info{$field}{'char'} ? 'char' : $field_info{$field}{'float'} ? 'float' : $field_info{$field}{'integer'} ? 'integer' : 'char'; if ($data_type eq 'char' && scalar @$size == 2) { $size = [ $size->[0] + $size->[1] ]; } my $field = $table->get_field($field); $field->size($size); $field->data_type($data_type); } } return 1; } 1; =pod =head1 AUTHORS Darren Chamberlain Edarren@cpan.orgE, Ken Y. Clark Ekclark@cpan.orgE. =head1 SEE ALSO Text::RecordParser, SQL::Translator. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/SQLServer.pm0000644000000000000000000003637514716630117023234 0ustar00rootroot00000000000000package SQL::Translator::Parser::SQLServer; =head1 NAME SQL::Translator::Parser::SQLServer - parser for SQL Server =head1 SYNOPSIS use SQL::Translator::Parser::SQLServer; =head1 DESCRIPTION Adapted from Parser::Sybase and mostly parses the output of Producer::SQLServer. The parsing is by no means complete and should probably be considered a work in progress. =cut use strict; use warnings; our $VERSION = '1.66'; our $DEBUG; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; use SQL::Translator::Utils qw/ddl_parser_instance/; use base qw(Exporter); our @EXPORT_OK = qw(parse); our $GRAMMAR = <<'END_OF_GRAMMAR'; { my ( %tables, @table_comments, $table_order, %procedures, $proc_order, %views, $view_order ); sub _err { my $max_lines = 5; my @up_to_N_lines = split (/\n/, $_[1], $max_lines + 1); die sprintf ("Unable to parse line %d:\n%s\n", $_[0], join "\n", (map { "'$_'" } @up_to_N_lines[0..$max_lines - 1 ]), @up_to_N_lines > $max_lines ? '...' : () ); } } startrule : statement(s) eofile { return { tables => \%tables, procedures => \%procedures, views => \%views, } } eofile : /^\Z/ statement : create_table | create_procedure | create_view | create_index | create_constraint | comment | disable_constraints | drop | use | setuser | if | print | grant | exec | /^\Z/ | { _err ($thisline, $text) } use : /use/i NAME GO { @table_comments = () } setuser : /setuser/i USERNAME GO if : /if/i object_not_null begin if_command end GO if_command : grant | create_index | create_constraint object_not_null : /object_id/i '(' SQSTRING ')' /is not null/i field_not_null : /where/i field_name /is \s+ not \s+ null/ix print : /\s*/ /print/i /.*/ else : /else/i /.*/ begin : /begin/i end : /end/i grant : /grant/i /[^\n]*/ exec : exec_statement(s) GO exec_statement : /exec/i /[^\n]+/ comment : /^\s*(?:#|-{2}).*\n/ { my $comment = $item[1]; $comment =~ s/^\s*(#|--)\s*//; $comment =~ s/\s*$//; $return = $comment; push @table_comments, $comment; } comment : comment_start comment_middle comment_end { my $comment = $item[2]; $comment =~ s/^\s*|\s*$//mg; $comment =~ s/^\**\s*//mg; push @table_comments, $comment; } comment_start : m#^\s*\/\*# comment_end : m#\s*\*\/# comment_middle : m{([^*]+|\*(?!/))*} drop : if_exists(?) /drop/i tbl_drop END_STATEMENT tbl_drop : /table/i ident if_exists : /if exists/i '(' /select/i 'name' /from/i 'sysobjects' /[^\)]+/ ')' # # Create table. # create_table : /create/i /table/i ident '(' create_def(s /,/) ')' lock(?) on_system(?) END_STATEMENT { my $table_owner = $item[3]{'owner'}; my $table_name = $item[3]{'name'}; if ( @table_comments ) { $tables{ $table_name }{'comments'} = [ @table_comments ]; @table_comments = (); } $tables{ $table_name }{'order'} = ++$table_order; $tables{ $table_name }{'name'} = $table_name; $tables{ $table_name }{'owner'} = $table_owner; $tables{ $table_name }{'system'} = $item[7]; my $i = 0; for my $def ( @{ $item[5] } ) { if ( $def->{'supertype'} eq 'field' ) { my $field_name = $def->{'name'}; $tables{ $table_name }{'fields'}{ $field_name } = { %$def, order => $i }; $i++; if ( $def->{'is_primary_key'} ) { push @{ $tables{ $table_name }{'constraints'} }, { type => 'primary_key', fields => [ $field_name ], }; } } elsif ( $def->{'supertype'} eq 'constraint' ) { push @{ $tables{ $table_name }{'constraints'} }, $def; } else { push @{ $tables{ $table_name }{'indices'} }, $def; } } } disable_constraints : if_exists(?) /alter/i /table/i ident /nocheck/i /constraint/i /all/i END_STATEMENT # this is for the normal case create_constraint : /create/i constraint END_STATEMENT { @table_comments = (); push @{ $tables{ $item[2]{'table'} }{'constraints'} }, $item[2]; } # and this is for the BEGIN/END case create_constraint : /create/i constraint { @table_comments = (); push @{ $tables{ $item[2]{'table'} }{'constraints'} }, $item[2]; } create_constraint : /alter/i /table/i ident /add/i foreign_key_constraint END_STATEMENT { push @{ $tables{ $item[3]{name} }{constraints} }, $item[5]; } create_index : /create/i index { @table_comments = (); push @{ $tables{ $item[2]{'table'} }{'indices'} }, $item[2]; } create_procedure : /create/i PROCEDURE WORD not_go GO { @table_comments = (); my $proc_name = $item[3]; my $owner = ''; my $sql = "$item[1] $item[2] $proc_name $item[4]"; $procedures{ $proc_name }{'order'} = ++$proc_order; $procedures{ $proc_name }{'name'} = $proc_name; $procedures{ $proc_name }{'owner'} = $owner; $procedures{ $proc_name }{'sql'} = $sql; } create_procedure : /create/i PROCEDURE '[' WORD '].' WORD not_go GO { @table_comments = (); my $proc_name = $item[6]; my $owner = $item[4]; my $sql = "$item[1] $item[2] [$owner].$proc_name $item[7]"; $procedures{ $proc_name }{'order'} = ++$proc_order; $procedures{ $proc_name }{'name'} = $proc_name; $procedures{ $proc_name }{'owner'} = $owner; $procedures{ $proc_name }{'sql'} = $sql; } PROCEDURE : /procedure/i | /function/i create_view : /create/i /view/i WORD not_go GO { @table_comments = (); my $view_name = $item[3]; my $sql = "$item[1] $item[2] $item[3] $item[4]"; $views{ $view_name }{'order'} = ++$view_order; $views{ $view_name }{'name'} = $view_name; $views{ $view_name }{'sql'} = $sql; } not_go : /((?!\bgo\b).)*/is create_def : constraint | index | field blank : /\s*/ field : field_name data_type field_qualifier(s?) { my %qualifiers = map { %$_ } @{ $item{'field_qualifier(s?)'} || [] }; my $nullable = defined $qualifiers{'nullable'} ? $qualifiers{'nullable'} : 1; $return = { supertype => 'field', name => $item{'field_name'}, data_type => $item{'data_type'}{'type'}, size => $item{'data_type'}{'size'}, nullable => $nullable, default => $qualifiers{'default_val'}, is_auto_inc => $qualifiers{'is_auto_inc'}, # is_primary_key => $item{'primary_key'}[0], } } field_qualifier : nullable { $return = { nullable => $item{'nullable'}, } } field_qualifier : default_val { $return = { default_val => $item{'default_val'}, } } field_qualifier : auto_inc { $return = { is_auto_inc => $item{'auto_inc'}, } } constraint : primary_key_constraint | foreign_key_constraint | unique_constraint field_name : NAME index_name : NAME table_name : NAME data_type : WORD field_size(?) { $return = { type => $item[1], size => $item[2][0] } } lock : /lock/i /datarows/i field_type : WORD field_size : '(' num_range ')' { $item{'num_range'} } num_range : DIGITS ',' DIGITS { $return = $item[1].','.$item[3] } | DIGITS { $return = $item[1] } nullable : /not/i /null/i { $return = 0 } | /null/i { $return = 1 } default_val : /default/i /null/i { $return = 'null' } | /default/i SQSTRING { $return = $item[2] } | /default/i WORD { $return = $item[2] } auto_inc : /identity/i { 1 } primary_key_constraint : /constraint/i index_name(?) /primary/i /key/i parens_field_list { $return = { supertype => 'constraint', name => $item[2][0], type => 'primary_key', fields => $item[5], } } foreign_key_constraint : /constraint/i index_name(?) /foreign/i /key/i parens_field_list /references/i table_name parens_field_list(?) on_delete(?) on_update(?) { $return = { supertype => 'constraint', name => $item[2][0], type => 'foreign_key', fields => $item[5], reference_table => $item[7], reference_fields => $item[8][0], on_delete => $item[9][0], on_update => $item[10][0], } } unique_constraint : /constraint/i index_name(?) /unique/i parens_field_list { $return = { supertype => 'constraint', type => 'unique', name => $item[2][0], fields => $item[4], } } unique_constraint : /unique/i clustered(?) INDEX(?) index_name(?) on_table(?) parens_field_list field_not_null(?) { $return = { supertype => 'constraint', type => 'unique', clustered => $item[2][0], name => $item[4][0], table => $item[5][0], fields => $item[6], } } on_delete : /on delete/i reference_option { $item[2] } on_update : /on update/i reference_option { $item[2] } reference_option: /cascade/i { $item[1] } | /no action/i { $item[1] } clustered : /clustered/i { $return = 1 } | /nonclustered/i { $return = 0 } INDEX : /index/i on_table : /on/i table_name { $return = $item[2] } on_system : /on/i /system/i { $return = 1 } index : clustered(?) INDEX index_name(?) on_table(?) parens_field_list END_STATEMENT { $return = { supertype => 'index', type => 'normal', clustered => $item[1][0], name => $item[3][0], table => $item[4][0], fields => $item[5], } } parens_field_list : '(' field_name(s /,/) ')' { $item[2] } ident : NAME '.' NAME { $return = { owner => $item[1], name => $item[3] } } | NAME { $return = { name => $item[1] } } END_STATEMENT : ';' | GO GO : /^go/i USERNAME : WORD | SQSTRING NAME : WORD | DQSTRING | BQSTRING WORD : /[\w#]+/ DIGITS : /\d+/ COMMA : ',' SQSTRING : "'" /(?:[^']|'')*/ "'" { ($return = $item[3]) =~ s/''/'/g } DQSTRING : '"' /(?:[^"]|"")+/ '"' { ($return = $item[3]) =~ s/""/"/g } BQSTRING : '[' /(?:[^]]|]])+/ ']' { ($return = $item[3]) =~ s/]]/]/g; } END_OF_GRAMMAR sub parse { my ($translator, $data) = @_; # Enable warnings within the Parse::RecDescent module. local $::RD_ERRORS = 1 unless defined $::RD_ERRORS; # Make sure the parser dies when it encounters an error local $::RD_WARN = 1 unless defined $::RD_WARN; # Enable warnings. This will warn on unused rules &c. local $::RD_HINT = 1 unless defined $::RD_HINT; # Give out hints to help fix problems. local $::RD_TRACE = $translator->trace ? 1 : undef; local $DEBUG = $translator->debug; my $parser = ddl_parser_instance('SQLServer'); my $result = $parser->startrule($data); return $translator->error("Parse failed.") unless defined $result; warn Dumper($result) if $DEBUG; my $schema = $translator->schema; my @tables = sort { $result->{tables}->{$a}->{'order'} <=> $result->{tables}->{$b}->{'order'} } keys %{ $result->{tables} }; for my $table_name (@tables) { my $tdata = $result->{tables}->{$table_name}; my $table = $schema->add_table(name => $tdata->{'name'}) or die "Can't create table '$table_name': ", $schema->error; $table->comments($tdata->{'comments'}); my @fields = sort { $tdata->{'fields'}->{$a}->{'order'} <=> $tdata->{'fields'}->{$b}->{'order'} } keys %{ $tdata->{'fields'} }; for my $fname (@fields) { my $fdata = $tdata->{'fields'}{$fname}; my $field = $table->add_field( name => $fdata->{'name'}, data_type => $fdata->{'data_type'}, size => $fdata->{'size'}, default_value => $fdata->{'default'}, is_auto_increment => $fdata->{'is_auto_inc'}, is_nullable => $fdata->{'nullable'}, comments => $fdata->{'comments'}, ) or die $table->error; $table->primary_key($field->name) if $fdata->{'is_primary_key'}; for my $qual (qw[ binary unsigned zerofill list ]) { if (my $val = $fdata->{$qual} || $fdata->{ uc $qual }) { next if ref $val eq 'ARRAY' && !@$val; $field->extra($qual, $val); } } if ($field->data_type =~ /(set|enum)/i && !$field->size) { my %extra = $field->extra; my $longest = 0; for my $len (map {length} @{ $extra{'list'} || [] }) { $longest = $len if $len > $longest; } $field->size($longest) if $longest; } for my $cdata (@{ $fdata->{'constraints'} }) { next unless $cdata->{'type'} eq 'foreign_key'; $cdata->{'fields'} ||= [ $field->name ]; push @{ $tdata->{'constraints'} }, $cdata; } } for my $idata (@{ $tdata->{'indices'} || [] }) { my $index = $table->add_index( name => $idata->{'name'}, type => uc $idata->{'type'}, fields => $idata->{'fields'}, ) or die $table->error; } for my $cdata (@{ $tdata->{'constraints'} || [] }) { my $constraint = $table->add_constraint( name => $cdata->{'name'}, type => $cdata->{'type'}, fields => $cdata->{'fields'}, reference_table => $cdata->{'reference_table'}, reference_fields => $cdata->{'reference_fields'}, match_type => $cdata->{'match_type'} || '', on_delete => $cdata->{'on_delete'} || $cdata->{'on_delete_do'}, on_update => $cdata->{'on_update'} || $cdata->{'on_update_do'}, ) or die $table->error; } } my @procedures = sort { $result->{procedures}->{$a}->{'order'} <=> $result->{procedures}->{$b}->{'order'} } keys %{ $result->{procedures} }; for my $proc_name (@procedures) { $schema->add_procedure( name => $proc_name, owner => $result->{procedures}->{$proc_name}->{owner}, sql => $result->{procedures}->{$proc_name}->{sql}, ); } my @views = sort { $result->{views}->{$a}->{'order'} <=> $result->{views}->{$b}->{'order'} } keys %{ $result->{views} }; for my $view_name (keys %{ $result->{views} }) { $schema->add_view( name => $view_name, sql => $result->{views}->{$view_name}->{sql}, ); } return 1; } 1; # ------------------------------------------------------------------- # Every hero becomes a bore at last. # Ralph Waldo Emerson # ------------------------------------------------------------------- =pod =head1 AUTHOR Chris Hilton Echris@dctank.comE - Bulk of code from Sybase parser, I just tweaked it for SQLServer. Thanks. =head1 SEE ALSO SQL::Translator, SQL::Translator::Parser::DBI, L. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/Storable.pm0000644000000000000000000000201214716630117023136 0ustar00rootroot00000000000000package SQL::Translator::Parser::Storable; =head1 NAME SQL::Translator::Parser::Storable - parser for Schema objects serialized with the Storable module =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new; $translator->parser('Storable'); =head1 DESCRIPTION Slurps in a Schema from a Storable file on disk. You can then turn the data into a database tables or graphs. =cut use strict; use warnings; our $VERSION = '1.66'; our $DEBUG; $DEBUG = 0 unless defined $DEBUG; use Storable; use SQL::Translator::Utils qw(debug normalize_name); use base qw(Exporter); our @EXPORT_OK = qw(parse); sub parse { my ($translator, $data) = @_; if (defined($data)) { $translator->{'schema'} = Storable::thaw($data); return 1; } elsif (defined($translator->filename)) { $translator->{'schema'} = Storable::retrieve($translator->filename); return 1; } return 0; } 1; =pod =head1 SEE ALSO SQL::Translator. =head1 AUTHOR Paul Harrington Eharringp@deshaw.comE. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/Oracle.pm0000644000000000000000000005413214716630117022602 0ustar00rootroot00000000000000package SQL::Translator::Parser::Oracle; =head1 NAME SQL::Translator::Parser::Oracle - parser for Oracle =head1 SYNOPSIS use SQL::Translator; use SQL::Translator::Parser::Oracle; my $translator = SQL::Translator->new; $translator->parser("SQL::Translator::Parser::Oracle"); =head1 DESCRIPTION From http://www.ss64.com/ora/table_c.html: CREATE [GLOBAL TEMPORARY] TABLE [schema.]table (tbl_defs,...) [ON COMMIT {DELETE|PRESERVE} ROWS] [storage_options | CLUSTER cluster_name (col1, col2,... ) | ORGANIZATION {HEAP [storage_options] | INDEX idx_organized_tbl_clause}] [LOB_storage_clause][varray_clause][nested_storage_clause] partitioning_options [[NO]CACHE] [[NO]MONITORING] [PARALLEL parallel_clause] [ENABLE enable_clause | DISABLE disable_clause] [AS subquery] tbl_defs: column datatype [DEFAULT expr] [column_constraint(s)] table_ref_constraint storage_options: PCTFREE int PCTUSED int INITTRANS int MAXTRANS int STORAGE storage_clause TABLESPACE tablespace [LOGGING|NOLOGGING] idx_organized_tbl_clause: storage_option(s) [PCTTHRESHOLD int] [COMPRESS int|NOCOMPRESS] [ [INCLUDING column_name] OVERFLOW [storage_option(s)] ] nested_storage_clause: NESTED TABLE nested_item STORE AS storage_table [RETURN AS {LOCATOR|VALUE} ] partitioning_options: Partition_clause {ENABLE|DISABLE} ROW MOVEMENT Column Constraints (http://www.ss64.com/ora/clause_constraint_col.html) CONSTRAINT constrnt_name {UNIQUE|PRIMARY KEY} constrnt_state CONSTRAINT constrnt_name CHECK(condition) constrnt_state CONSTRAINT constrnt_name [NOT] NULL constrnt_state CONSTRAINT constrnt_name REFERENCES [schema.]table[(column)] [ON DELETE {CASCADE|SET NULL}] constrnt_state constrnt_state [[NOT] DEFERRABLE] [INITIALLY {IMMEDIATE|DEFERRED}] [RELY | NORELY] [USING INDEX using_index_clause] [ENABLE|DISABLE] [VALIDATE|NOVALIDATE] [EXCEPTIONS INTO [schema.]table] Note that probably not all of the above syntax is supported, but the grammar was altered to better handle the syntax created by DDL::Oracle. =cut use strict; use warnings; our $VERSION = '1.66'; our $DEBUG; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; use SQL::Translator::Utils qw/ddl_parser_instance/; use base qw(Exporter); our @EXPORT_OK = qw(parse); our $GRAMMAR = <<'END_OF_GRAMMAR'; { my ( %tables, %indices, %constraints, $table_order, @table_comments, %views, $view_order, %procedures, $proc_order, %triggers, $trigger_order ) } # # The "eofile" rule makes the parser fail if any "statement" rule # fails. Otherwise, the first successful match by a "statement" # won't cause the failure needed to know that the parse, as a whole, # failed. -ky # startrule : statement(s) eofile { $return = { tables => \%tables, indices => \%indices, constraints => \%constraints, views => \%views, procedures => \%procedures, triggers => \%triggers, }; } eofile : /^\Z/ statement : remark | run | prompt | create | table_comment | comment_on_table | comment_on_column | alter | drop | alter: /alter/i TABLE table_name /add/i table_constraint ';' { my $constraint = $item{table_constraint}; $constraint->{type} = $constraint->{constraint_type}; push @{$tables{$item{table_name}}{constraints}}, $constraint; } alter : /alter/i WORD /[^;]+/ ';' { @table_comments = () } drop : /drop/i WORD(s) NAME WORD(s?) ';' { @table_comments = () } create : create_table table_name '(' create_definition(s /,/) ')' table_option(s?) ';' { my $table_name = $item{'table_name'}; $tables{ $table_name }{'order'} = ++$table_order; $tables{ $table_name }{'table_name'} = $table_name; if ( @table_comments ) { $tables{ $table_name }{'comments'} = [ @table_comments ]; @table_comments = (); } my $i = 1; my @constraints; for my $definition ( @{ $item[4] } ) { if ( $definition->{'type'} eq 'field' ) { my $field_name = $definition->{'name'}; $tables{ $table_name }{'fields'}{ $field_name } = { %$definition, order => $i }; $i++; for my $constraint ( @{ $definition->{'constraints'} || [] } ) { $constraint->{'fields'} = [ $field_name ]; push @{ $tables{ $table_name }{'constraints'} }, $constraint; } } elsif ( $definition->{'type'} eq 'constraint' ) { $definition->{'type'} = $definition->{'constraint_type'}; push @{ $tables{ $table_name }{'constraints'} }, $definition; } else { push @{ $tables{ $table_name }{'indices'} }, $definition; } } for my $option ( @{ $item[6] } ) { push @{ $tables{ $table_name }{'table_options'} }, $option; } 1; } create : create_index index_name /on/i table_name index_expr table_option(?) ';' { my $table_name = $item[4]; if ( $item[1] ) { push @{ $constraints{ $table_name } }, { name => $item[2], type => 'unique', fields => $item[5], }; } else { push @{ $indices{ $table_name } }, { name => $item[2], type => 'normal', fields => $item[5], }; } } index_expr: parens_name_list { $item[1] } | '(' WORD parens_name_list ')' { my $arg_list = join(",", @{$item[3]}); $return = "$item[2]($arg_list)"; } create : /create/i /or replace/i /trigger/i table_name not_end m#^/$#im { @table_comments = (); my $trigger_name = $item[4]; # Hack to strip owner from trigger name $trigger_name =~ s#.*\.##; my $owner = ''; my $action = "$item[1] $item[2] $item[3] $item[4] $item[5]"; $triggers{ $trigger_name }{'order'} = ++$trigger_order; $triggers{ $trigger_name }{'name'} = $trigger_name; $triggers{ $trigger_name }{'owner'} = $owner; $triggers{ $trigger_name }{'action'} = $action; } create : /create/i /or replace/i /procedure/i table_name not_end m#^/$#im { @table_comments = (); my $proc_name = $item[4]; # Hack to strip owner from procedure name $proc_name =~ s#.*\.##; my $owner = ''; my $sql = "$item[1] $item[2] $item[3] $item[4] $item[5]"; $procedures{ $proc_name }{'order'} = ++$proc_order; $procedures{ $proc_name }{'name'} = $proc_name; $procedures{ $proc_name }{'owner'} = $owner; $procedures{ $proc_name }{'sql'} = $sql; } not_end: m#.*?(?=^/$)#ism create : /create/i /or replace/i /force/i /view/i table_name not_delimiter ';' { @table_comments = (); my $view_name = $item[5]; # Hack to strip owner from view name $view_name =~ s#.*\.##; my $sql = "$item[1] $item[2] $item[3] $item[4] $item[5] $item[6] $item[7]"; $views{ $view_name }{'order'} = ++$view_order; $views{ $view_name }{'name'} = $view_name; $views{ $view_name }{'sql'} = $sql; } not_delimiter: /.*?(?=;)/is # Create anything else (e.g., domain, function, etc.) create : ...!create_table ...!create_index /create/i WORD /[^;]+/ ';' { @table_comments = () } create_index : /create/i UNIQUE(?) /index/i { $return = @{$item[2]} } index_name : NAME '.' NAME { $item[3] } | NAME { $item[1] } global_temporary: /global/i /temporary/i table_name : NAME '.' NAME { $item[3] } | NAME { $item[1] } create_definition : table_constraint | field | table_comment : comment { my $comment = $item[1]; $return = $comment; push @table_comments, $comment; } comment : /^\s*(?:#|-{2}).*\n/ { my $comment = $item[1]; $comment =~ s/^\s*(#|-{2})\s*//; $comment =~ s/\s*$//; $return = $comment; } comment : /\/\*/ /[^\*]+/ /\*\// { my $comment = $item[2]; $comment =~ s/^\s*|\s*$//g; $return = $comment; } remark : /^REM\s+.*\n/ run : /^(RUN|\/)\s+.*\n/ prompt : /prompt/i /(table|index|sequence|trigger)/i ';' prompt : /prompt\s+create\s+.*\n/i comment_on_table : /comment/i /on/i /table/i table_name /is/i comment_phrase ';' { push @{ $tables{ $item{'table_name'} }{'comments'} }, $item{'comment_phrase'}; } comment_on_column : /comment/i /on/i /column/i column_name /is/i comment_phrase ';' { my $table_name = $item[4]->{'table'}; my $field_name = $item[4]->{'field'}; push @{ $tables{ $table_name }{'fields'}{ $field_name }{'comments'} }, $item{'comment_phrase'}; } column_name : NAME '.' NAME { $return = { table => $item[1], field => $item[3] } } comment_phrase : /'.*?'/ { my $val = $item[1]; $val =~ s/^'|'$//g; $return = $val; } field : comment(s?) field_name data_type field_meta(s?) comment(s?) { my ( $is_pk, $default, @constraints ); my $null = 1; for my $meta ( @{ $item[4] } ) { if ( $meta->{'type'} eq 'default' ) { $default = $meta; next; } elsif ( $meta->{'type'} eq 'not_null' ) { $null = 0; next; } elsif ( $meta->{'type'} eq 'primary_key' ) { $is_pk = 1; } push @constraints, $meta if $meta->{'supertype'} eq 'constraint'; } my @comments = ( @{ $item[1] }, @{ $item[5] } ); $return = { type => 'field', name => $item{'field_name'}, data_type => $item{'data_type'}{'type'}, size => $item{'data_type'}{'size'}, null => $null, default => $default->{'value'}, is_primary_key => $is_pk, constraints => [ @constraints ], comments => [ @comments ], } } | field_name : NAME data_type : ora_data_type data_size(?) { $return = { type => $item[1], size => $item[2][0] || '', } } data_size : '(' VALUE(s /,/) data_size_modifier(?) ')' { $item[2] } data_size_modifier: /byte/i | /char/i column_constraint : constraint_name(?) column_constraint_type constraint_state(s?) { my $desc = $item{'column_constraint_type'}; my $type = $desc->{'type'}; my $fields = $desc->{'fields'} || []; my $expression = $desc->{'expression'} || ''; $return = { supertype => 'constraint', name => $item{'constraint_name(?)'}[0] || '', type => $type, expression => $type eq 'check' ? $expression : '', deferrable => $desc->{'deferrable'}, deferred => $desc->{'deferred'}, reference_table => $desc->{'reference_table'}, reference_fields => $desc->{'reference_fields'}, # match_type => $desc->{'match_type'}, # on_update => $desc->{'on_update'}, } } constraint_name : /constraint/i NAME { $item[2] } column_constraint_type : /not\s+null/i { $return = { type => 'not_null' } } | /unique/i { $return = { type => 'unique' } } | /primary\s+key/i { $return = { type => 'primary_key' } } | /check/i check_expression { $return = { type => 'check', expression => $item[2], }; } | /references/i table_name parens_name_list(?) on_delete(?) { $return = { type => 'foreign_key', reference_table => $item[2], reference_fields => $item[3][0], # match_type => $item[4][0], on_delete => $item[5][0], } } LPAREN : '(' RPAREN : ')' check_condition_text : /.+\s+in\s+\([^)]+\)/i | /[^)]+/ check_expression : LPAREN check_condition_text RPAREN { $return = join( ' ', map { $_ || () } $item[1], $item[2], $item[3], $item[4][0] ) } constraint_state : deferrable { $return = { type => $item[1] } } | deferred { $return = { type => $item[1] } } | /(no)?rely/i { $return = { type => $item[1] } } # | /using/i /index/i using_index_clause # { $return = { type => 'using_index', index => $item[3] } } | /(dis|en)able/i { $return = { type => $item[1] } } | /(no)?validate/i { $return = { type => $item[1] } } | /exceptions/i /into/i table_name { $return = { type => 'exceptions_into', table => $item[3] } } deferrable : /not/i /deferrable/i { $return = 'not_deferrable' } | /deferrable/i { $return = 'deferrable' } deferred : /initially/i /(deferred|immediate)/i { $item[2] } ora_data_type : /(n?varchar2|varchar)/i { $return = 'varchar2' } | /n?char/i { $return = 'character' } | /n?dec/i { $return = 'decimal' } | /number/i { $return = 'number' } | /integer/i { $return = 'integer' } | /(pls_integer|binary_integer)/i { $return = 'integer' } | /interval\s+day/i { $return = 'interval day' } | /interval\s+year/i { $return = 'interval year' } | /long\s+raw/i { $return = 'long raw' } | /(long|date|timestamp|raw|rowid|urowid|mlslabel|clob|nclob|blob|bfile|float|double)/i { $item[1] } parens_value_list : '(' VALUE(s /,/) ')' { $item[2] } parens_word_list : '(' WORD(s /,/) ')' { $item[2] } parens_name_list : '(' NAME(s /,/) ')' { $item[2] } field_meta : default_val | column_constraint default_val : /default/i CURRENT_TIMESTAMP { my $val = $item[2]; $return = { supertype => 'constraint', type => 'default', value => $val, } } | /default/i VALUE { my $val = $item[2]; $return = { supertype => 'constraint', type => 'default', value => $val, } } | /null/i { $return = { supertype => 'constraint', type => 'default', value => 'NULL', } } create_table : /create/i global_temporary(?) /table/i table_option : /organization/i WORD { $return = { 'ORGANIZATION' => $item[2] } } table_option : /nomonitoring/i { $return = { 'NOMONITORING' => undef } } table_option : /parallel/i '(' key_value(s) ')' { $return = { 'PARALLEL' => $item[3] } } key_value : WORD VALUE { $return = { $item[1], $item[2] } } table_option : /[^;]+/ table_constraint : comment(s?) constraint_name(?) table_constraint_type deferrable(?) deferred(?) constraint_state(s?) comment(s?) { my $desc = $item{'table_constraint_type'}; my $type = $desc->{'type'}; my $fields = $desc->{'fields'}; my $expression = $desc->{'expression'}; my @comments = ( @{ $item[1] }, @{ $item[-1] } ); $return = { name => $item{'constraint_name(?)'}[0] || '', type => 'constraint', constraint_type => $type, fields => $type ne 'check' ? $fields : [], expression => $type eq 'check' ? $expression : '', deferrable => $item{'deferrable(?)'}, deferred => $item{'deferred(?)'}, reference_table => $desc->{'reference_table'}, reference_fields => $desc->{'reference_fields'}, # match_type => $desc->{'match_type'}[0], on_delete => $desc->{'on_delete'} || $desc->{'on_delete_do'}, on_update => $desc->{'on_update'} || $desc->{'on_update_do'}, comments => [ @comments ], } } table_constraint_type : /primary key/i '(' NAME(s /,/) ')' { $return = { type => 'primary_key', fields => $item[3], } } | /unique/i '(' NAME(s /,/) ')' { $return = { type => 'unique', fields => $item[3], } } | /check/i check_expression /^(en|dis)able/i { $return = { type => 'check', expression => join(' ', $item[2], $item[3]), } } | /foreign key/i '(' NAME(s /,/) ')' /references/i table_name parens_name_list(?) on_delete(?) { $return = { type => 'foreign_key', fields => $item[3], reference_table => $item[6], reference_fields => $item[7][0], # match_type => $item[8][0], on_delete => $item[8][0], # on_update => $item[9][0], } } on_delete : /on delete/i WORD(s) { join(' ', @{$item[2]}) } UNIQUE : /unique/i { $return = 1 } WORD : /\w+/ NAME : /\w+/ { $item[1] } | DQSTRING TABLE : /table/i DQSTRING : '"' /((?:[^"]|"")+)/ '"' { ($return = $item[3]) =~ s/""/"/g; } SQSTRING : "'" /((?:[^']|'')*)/ "'" { ($return = $item[3]) =~ s/''/'/g } VALUE : /[-+]?\d*\.?\d+(?:[eE]\d+)?/ | SQSTRING | /null/i { 'NULL' } # always a scalar-ref, so that it is treated as a function and not quoted by consumers CURRENT_TIMESTAMP : /current_timestamp(\(\))?/i { \'CURRENT_TIMESTAMP' } | /now\(\)/i { \'CURRENT_TIMESTAMP' } END_OF_GRAMMAR sub parse { my ($translator, $data) = @_; # Enable warnings within the Parse::RecDescent module. local $::RD_ERRORS = 1 unless defined $::RD_ERRORS; # Make sure the parser dies when it encounters an error local $::RD_WARN = 1 unless defined $::RD_WARN; # Enable warnings. This will warn on unused rules &c. local $::RD_HINT = 1 unless defined $::RD_HINT; # Give out hints to help fix problems. local $::RD_TRACE = $translator->trace ? 1 : undef; local $DEBUG = $translator->debug; my $parser = ddl_parser_instance('Oracle'); my $result = $parser->startrule($data); die "Parse failed.\n" unless defined $result; if ($DEBUG) { warn "Parser results =\n", Dumper($result), "\n"; } my $schema = $translator->schema; my $indices = $result->{'indices'}; my $constraints = $result->{'constraints'}; my @tables = sort { $result->{'tables'}{$a}{'order'} <=> $result->{'tables'}{$b}{'order'} } keys %{ $result->{'tables'} }; for my $table_name (@tables) { my $tdata = $result->{'tables'}{$table_name}; next unless $tdata->{'table_name'}; my $table = $schema->add_table( name => $tdata->{'table_name'}, comments => $tdata->{'comments'}, ) or die $schema->error; $table->options($tdata->{'table_options'}); my @fields = sort { $tdata->{'fields'}->{$a}->{'order'} <=> $tdata->{'fields'}->{$b}->{'order'} } keys %{ $tdata->{'fields'} }; for my $fname (@fields) { my $fdata = $tdata->{'fields'}{$fname}; my $field = $table->add_field( name => $fdata->{'name'}, data_type => $fdata->{'data_type'}, size => $fdata->{'size'}, default_value => $fdata->{'default'}, is_auto_increment => $fdata->{'is_auto_inc'}, is_nullable => $fdata->{'null'}, comments => $fdata->{'comments'}, ) or die $table->error; } push @{ $tdata->{'indices'} }, @{ $indices->{$table_name} || [] }; push @{ $tdata->{'constraints'} }, @{ $constraints->{$table_name} || [] }; for my $idata (@{ $tdata->{'indices'} || [] }) { my $index = $table->add_index( name => $idata->{'name'}, type => uc $idata->{'type'}, fields => $idata->{'fields'}, ) or die $table->error; } for my $cdata (@{ $tdata->{'constraints'} || [] }) { my $constraint = $table->add_constraint( name => $cdata->{'name'}, type => $cdata->{'type'}, fields => $cdata->{'fields'}, expression => $cdata->{'expression'}, reference_table => $cdata->{'reference_table'}, reference_fields => $cdata->{'reference_fields'}, match_type => $cdata->{'match_type'} || '', on_delete => $cdata->{'on_delete'} || $cdata->{'on_delete_do'}, on_update => $cdata->{'on_update'} || $cdata->{'on_update_do'}, ) or die $table->error; } } my @procedures = sort { $result->{procedures}->{$a}->{'order'} <=> $result->{procedures}->{$b}->{'order'} } keys %{ $result->{procedures} }; foreach my $proc_name (@procedures) { $schema->add_procedure( name => $proc_name, owner => $result->{procedures}->{$proc_name}->{owner}, sql => $result->{procedures}->{$proc_name}->{sql}, ); } my @views = sort { $result->{views}->{$a}->{'order'} <=> $result->{views}->{$b}->{'order'} } keys %{ $result->{views} }; foreach my $view_name (keys %{ $result->{views} }) { $schema->add_view( name => $view_name, sql => $result->{views}->{$view_name}->{sql}, ); } my @triggers = sort { $result->{triggers}->{$a}->{'order'} <=> $result->{triggers}->{$b}->{'order'} } keys %{ $result->{triggers} }; foreach my $trigger_name (@triggers) { $schema->add_trigger( name => $trigger_name, action => $result->{triggers}->{$trigger_name}->{action}, ); } return 1; } 1; # ------------------------------------------------------------------- # Something there is that doesn't love a wall. # Robert Frost # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =head1 SEE ALSO SQL::Translator, Parse::RecDescent, DDL::Oracle. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/Access.pm0000644000000000000000000002600114716630117022570 0ustar00rootroot00000000000000package SQL::Translator::Parser::Access; =head1 NAME SQL::Translator::Parser::Access - parser for Access as produced by mdbtools =head1 SYNOPSIS use SQL::Translator; use SQL::Translator::Parser::Access; my $translator = SQL::Translator->new; $translator->parser("SQL::Translator::Parser::Access"); =head1 DESCRIPTION The grammar derived from the MySQL grammar. The input is expected to be something similar to the output of mdbtools (http://mdbtools.sourceforge.net/). =cut use strict; use warnings; our $VERSION = '1.66'; our $DEBUG; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; use SQL::Translator::Utils qw/ddl_parser_instance/; use base qw(Exporter); our @EXPORT_OK = qw(parse); our $GRAMMAR = <<'END_OF_GRAMMAR'; { my ( %tables, $table_order, @table_comments ); } # # The "eofile" rule makes the parser fail if any "statement" rule # fails. Otherwise, the first successful match by a "statement" # won't cause the failure needed to know that the parse, as a whole, # failed. -ky # startrule : statement(s) eofile { \%tables } eofile : /^\Z/ statement : comment | use | set | drop | create | use : /use/i WORD ';' { @table_comments = () } set : /set/i /[^;]+/ ';' { @table_comments = () } drop : /drop/i TABLE /[^;]+/ ';' drop : /drop/i WORD(s) ';' { @table_comments = () } create : CREATE /database/i WORD ';' { @table_comments = () } create : CREATE TABLE table_name '(' create_definition(s /,/) ')' ';' { my $table_name = $item{'table_name'}; $tables{ $table_name }{'order'} = ++$table_order; $tables{ $table_name }{'table_name'} = $table_name; if ( @table_comments ) { $tables{ $table_name }{'comments'} = [ @table_comments ]; @table_comments = (); } my $i = 1; for my $definition ( @{ $item[5] } ) { if ( $definition->{'supertype'} eq 'field' ) { my $field_name = $definition->{'name'}; $tables{ $table_name }{'fields'}{ $field_name } = { %$definition, order => $i }; $i++; if ( $definition->{'is_primary_key'} ) { push @{ $tables{ $table_name }{'constraints'} }, { type => 'primary_key', fields => [ $field_name ], } ; } } elsif ( $definition->{'supertype'} eq 'constraint' ) { push @{ $tables{ $table_name }{'constraints'} }, $definition; } elsif ( $definition->{'supertype'} eq 'index' ) { push @{ $tables{ $table_name }{'indices'} }, $definition; } } 1; } create : CREATE UNIQUE(?) /(index|key)/i index_name /on/i table_name '(' field_name(s /,/) ')' ';' { @table_comments = (); push @{ $tables{ $item{'table_name'} }{'indices'} }, { name => $item[4], type => $item[2] ? 'unique' : 'normal', fields => $item[8], } ; } create_definition : constraint | index | field | comment | comment : /^\s*--(.*)\n/ { my $comment = $1; $return = $comment; push @table_comments, $comment; } field : field_name data_type field_qualifier(s?) reference_definition(?) { $return = { supertype => 'field', name => $item{'field_name'}, data_type => $item{'data_type'}{'type'}, size => $item{'data_type'}{'size'}, constraints => $item{'reference_definition(?)'}, } } | field_qualifier : not_null { $return = { null => $item{'not_null'}, } } field_qualifier : default_val { $return = { default => $item{'default_val'}, } } field_qualifier : auto_inc { $return = { is_auto_inc => $item{'auto_inc'}, } } field_qualifier : primary_key { $return = { is_primary_key => $item{'primary_key'}, } } field_qualifier : unsigned { $return = { is_unsigned => $item{'unsigned'}, } } field_qualifier : /character set/i WORD { $return = { character_set => $item[2], } } reference_definition : /references/i table_name parens_field_list(?) match_type(?) on_delete(?) on_update(?) { $return = { type => 'foreign_key', reference_table => $item[2], reference_fields => $item[3][0], match_type => $item[4][0], on_delete => $item[5][0], on_update => $item[6][0], } } match_type : /match full/i { 'full' } | /match partial/i { 'partial' } on_delete : /on delete/i reference_option { $item[2] } on_update : /on update/i reference_option { $item[2] } reference_option: /restrict/i | /cascade/i | /set null/i | /no action/i | /set default/i { $item[1] } index : normal_index | fulltext_index | table_name : NAME field_name : NAME index_name : NAME data_type : access_data_type parens_value_list(s?) type_qualifier(s?) { $return = { type => $item[1], size => $item[2][0], qualifiers => $item[3], } } access_data_type : /long integer/i { $return = 'Long Integer' } | /text/i { $return = 'Text' } | /datetime (\(short\))?/i { $return = 'DateTime' } | /boolean/i { $return = 'Boolean' } | WORD parens_field_list : '(' field_name(s /,/) ')' { $item[2] } parens_value_list : '(' VALUE(s /,/) ')' { $item[2] } type_qualifier : /(BINARY|UNSIGNED|ZEROFILL)/i { lc $item[1] } field_type : WORD create_index : /create/i /index/i not_null : /not/i /null/i { $return = 0 } unsigned : /unsigned/i { $return = 0 } default_val : /default/i /'(?:.*?\')*.*?'|(?:')?[\w\d:.-]*(?:')?/ { $item[2] =~ s/^\s*'|'\s*$//g; $return = $item[2]; } auto_inc : /auto_increment/i { 1 } primary_key : /primary/i /key/i { 1 } constraint : primary_key_def | unique_key_def | foreign_key_def | foreign_key_def : foreign_key_def_begin parens_field_list reference_definition { $return = { supertype => 'constraint', type => 'foreign_key', name => $item[1], fields => $item[2], %{ $item{'reference_definition'} }, } } foreign_key_def_begin : /constraint/i /foreign key/i { $return = '' } | /constraint/i WORD /foreign key/i { $return = $item[2] } | /foreign key/i { $return = '' } primary_key_def : primary_key index_name(?) '(' name_with_opt_paren(s /,/) ')' { $return = { supertype => 'constraint', name => $item{'index_name(?)'}[0], type => 'primary_key', fields => $item[4], }; } unique_key_def : UNIQUE KEY(?) index_name(?) '(' name_with_opt_paren(s /,/) ')' { $return = { supertype => 'constraint', name => $item{'index_name(?)'}[0], type => 'unique', fields => $item[5], } } normal_index : KEY index_name(?) '(' name_with_opt_paren(s /,/) ')' { $return = { supertype => 'index', type => 'normal', name => $item{'index_name(?)'}[0], fields => $item[4], } } fulltext_index : /fulltext/i KEY(?) index_name(?) '(' name_with_opt_paren(s /,/) ')' { $return = { supertype => 'index', type => 'fulltext', name => $item{'index_name(?)'}[0], fields => $item[5], } } name_with_opt_paren : NAME parens_value_list(s?) { $item[2][0] ? "$item[1]($item[2][0][0])" : $item[1] } UNIQUE : /unique/i { 1 } KEY : /key/i | /index/i table_option : WORD /\s*=\s*/ WORD { $return = { $item[1] => $item[3] }; } CREATE : /create/i TEMPORARY : /temporary/i TABLE : /table/i WORD : /\w+/ DIGITS : /\d+/ COMMA : ',' NAME : "`" /\w+/ "`" { $item[2] } | /\w+/ { $item[1] } VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ { $item[1] } | /'.*?'/ { # remove leading/trailing quotes my $val = $item[1]; $val =~ s/^['"]|['"]$//g; $return = $val; } | /NULL/ { 'NULL' } END_OF_GRAMMAR sub parse { my ($translator, $data) = @_; # Enable warnings within the Parse::RecDescent module. local $::RD_ERRORS = 1 unless defined $::RD_ERRORS; # Make sure the parser dies when it encounters an error local $::RD_WARN = 1 unless defined $::RD_WARN; # Enable warnings. This will warn on unused rules &c. local $::RD_HINT = 1 unless defined $::RD_HINT; # Give out hints to help fix problems. local $::RD_TRACE = $translator->trace ? 1 : undef; local $DEBUG = $translator->debug; my $parser = ddl_parser_instance('Access'); my $result = $parser->startrule($data); return $translator->error("Parse failed.") unless defined $result; warn Dumper($result) if $DEBUG; my $schema = $translator->schema; my @tables = sort { $result->{$a}->{'order'} <=> $result->{$b}->{'order'} } keys %{$result}; for my $table_name (@tables) { my $tdata = $result->{$table_name}; my $table = $schema->add_table(name => $tdata->{'table_name'},) or die $schema->error; $table->comments($tdata->{'comments'}); my @fields = sort { $tdata->{'fields'}->{$a}->{'order'} <=> $tdata->{'fields'}->{$b}->{'order'} } keys %{ $tdata->{'fields'} }; for my $fname (@fields) { my $fdata = $tdata->{'fields'}{$fname}; my $field = $table->add_field( name => $fdata->{'name'}, data_type => $fdata->{'data_type'}, size => $fdata->{'size'}, default_value => $fdata->{'default'}, is_auto_increment => $fdata->{'is_auto_inc'}, is_nullable => $fdata->{'null'}, comments => $fdata->{'comments'}, ) or die $table->error; $table->primary_key($field->name) if $fdata->{'is_primary_key'}; } for my $idata (@{ $tdata->{'indices'} || [] }) { my $index = $table->add_index( name => $idata->{'name'}, type => uc $idata->{'type'}, fields => $idata->{'fields'}, ) or die $table->error; } } return 1; } 1; # ------------------------------------------------------------------- # Where man is not nature is barren. # William Blake # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Y. Clark Ekclark@cpan.orgE. =head1 SEE ALSO perl(1), Parse::RecDescent, SQL::Translator::Schema. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser/YAML.pm0000644000000000000000000000637414716630117022144 0ustar00rootroot00000000000000package SQL::Translator::Parser::YAML; use strict; use warnings; our $VERSION = '1.66'; use SQL::Translator::Schema; use SQL::Translator::Utils qw(header_comment); use Data::Dumper; use YAML qw(Load); sub parse { my ($translator, $data) = @_; $data = Load($data); $data = $data->{'schema'}; warn "YAML data:", Dumper($data) if $translator->debug; my $schema = $translator->schema; # # Tables # my @tables = map { $data->{'tables'}{ $_->[1] } } sort { $a->[0] <=> $b->[0] } map { [ $data->{'tables'}{$_}{'order'} || 0, $_ ] } keys %{ $data->{'tables'} }; for my $tdata (@tables) { my $table = $schema->add_table(map { $tdata->{$_} ? ($_ => $tdata->{$_}) : () } (qw/name extra options/)) or die $schema->error; my @fields = map { $tdata->{'fields'}{ $_->[1] } } sort { $a->[0] <=> $b->[0] } map { [ $tdata->{'fields'}{$_}{'order'}, $_ ] } keys %{ $tdata->{'fields'} }; for my $fdata (@fields) { $table->add_field(%$fdata) or die $table->error; $table->primary_key($fdata->{'name'}) if $fdata->{'is_primary_key'}; } for my $idata (@{ $tdata->{'indices'} || [] }) { $table->add_index(%$idata) or die $table->error; } for my $cdata (@{ $tdata->{'constraints'} || [] }) { $table->add_constraint(%$cdata) or die $table->error; } $table->comments($tdata->{'comments'}) if exists $tdata->{'comments'}; } # # Views # my @views = map { $data->{'views'}{ $_->[1] } } sort { $a->[0] <=> $b->[0] } map { [ $data->{'views'}{$_}{'order'}, $_ ] } keys %{ $data->{'views'} }; for my $vdata (@views) { $schema->add_view(%$vdata) or die $schema->error; } # # Triggers # my @triggers = map { $data->{'triggers'}{ $_->[1] } } sort { $a->[0] <=> $b->[0] } map { [ $data->{'triggers'}{$_}{'order'}, $_ ] } keys %{ $data->{'triggers'} }; for my $tdata (@triggers) { $schema->add_trigger(%$tdata) or die $schema->error; } # # Procedures # my @procedures = map { $data->{'procedures'}{ $_->[1] } } sort { $a->[0] <=> $b->[0] } map { [ $data->{'procedures'}{$_}{'order'}, $_ ] } keys %{ $data->{'procedures'} }; for my $tdata (@procedures) { $schema->add_procedure(%$tdata) or die $schema->error; } if (my $tr_data = $data->{'translator'}) { $translator->add_drop_table($tr_data->{'add_drop_table'}); $translator->filename($tr_data->{'filename'}); $translator->no_comments($tr_data->{'no_comments'}); $translator->parser_args($tr_data->{'parser_args'}); $translator->producer_args($tr_data->{'producer_args'}); $translator->parser_type($tr_data->{'parser_type'}); $translator->producer_type($tr_data->{'producer_type'}); $translator->show_warnings($tr_data->{'show_warnings'}); $translator->trace($tr_data->{'trace'}); } return 1; } 1; __END__ =head1 NAME SQL::Translator::Parser::YAML - Parse a YAML representation of a schema =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new(parser => "YAML"); =head1 DESCRIPTION C parses a schema serialized with YAML. =head1 AUTHORS Darren Chamberlain Edarren@cpan.orgE, Ken Y. Clark Ekclark@cpan.orgE. SQL-Translator-1.66/lib/SQL/Translator/Parser/SQLite.pm0000644000000000000000000004472114716630117022541 0ustar00rootroot00000000000000package SQL::Translator::Parser::SQLite; =head1 NAME SQL::Translator::Parser::SQLite - parser for SQLite =head1 SYNOPSIS use SQL::Translator; use SQL::Translator::Parser::SQLite; my $translator = SQL::Translator->new; $translator->parser("SQL::Translator::Parser::SQLite"); =head1 DESCRIPTION This is a grammar for parsing CREATE statements for SQLite as described here: http://www.sqlite.org/lang.html CREATE INDEX sql-statement ::= CREATE [TEMP | TEMPORARY] [UNIQUE] INDEX index-name ON [database-name .] table-name ( column-name [, column-name]* ) [ ON CONFLICT conflict-algorithm ] column-name ::= name [ ASC | DESC ] CREATE TABLE sql-command ::= CREATE [TEMP | TEMPORARY] TABLE table-name ( column-def [, column-def]* [, constraint]* ) sql-command ::= CREATE [TEMP | TEMPORARY] TABLE table-name AS select-statement column-def ::= name [type] [[CONSTRAINT name] column-constraint]* type ::= typename | typename ( number ) | typename ( number , number ) column-constraint ::= NOT NULL [ conflict-clause ] | PRIMARY KEY [sort-order] [ conflict-clause ] | UNIQUE [ conflict-clause ] | CHECK ( expr ) [ conflict-clause ] | DEFAULT value constraint ::= PRIMARY KEY ( name [, name]* ) [ conflict-clause ]| UNIQUE ( name [, name]* ) [ conflict-clause ] | CHECK ( expr ) [ conflict-clause ] conflict-clause ::= ON CONFLICT conflict-algorithm CREATE TRIGGER sql-statement ::= CREATE [TEMP | TEMPORARY] TRIGGER trigger-name [ BEFORE | AFTER ] database-event ON [database-name .] table-name trigger-action sql-statement ::= CREATE [TEMP | TEMPORARY] TRIGGER trigger-name INSTEAD OF database-event ON [database-name .] view-name trigger-action database-event ::= DELETE | INSERT | UPDATE | UPDATE OF column-list trigger-action ::= [ FOR EACH ROW | FOR EACH STATEMENT ] [ WHEN expression ] BEGIN trigger-step ; [ trigger-step ; ]* END trigger-step ::= update-statement | insert-statement | delete-statement | select-statement CREATE VIEW sql-command ::= CREATE [TEMP | TEMPORARY] VIEW view-name AS select-statement ON CONFLICT clause conflict-clause ::= ON CONFLICT conflict-algorithm conflict-algorithm ::= ROLLBACK | ABORT | FAIL | IGNORE | REPLACE expression expr ::= expr binary-op expr | expr like-op expr | unary-op expr | ( expr ) | column-name | table-name . column-name | database-name . table-name . column-name | literal-value | function-name ( expr-list | * ) | expr (+) | expr ISNULL | expr NOTNULL | expr [NOT] BETWEEN expr AND expr | expr [NOT] IN ( value-list ) | expr [NOT] IN ( select-statement ) | ( select-statement ) | CASE [expr] ( WHEN expr THEN expr )+ [ELSE expr] END like-op::= LIKE | GLOB | NOT LIKE | NOT GLOB =cut use strict; use warnings; our $VERSION = '1.66'; our $DEBUG; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; use SQL::Translator::Utils qw/ddl_parser_instance/; use base qw(Exporter); our @EXPORT_OK = qw(parse); our $GRAMMAR = <<'END_OF_GRAMMAR'; { my ( %tables, $table_order, @views, @triggers ); sub _err { my $max_lines = 5; my @up_to_N_lines = split (/\n/, $_[1], $max_lines + 1); die sprintf ("Unable to parse line %d:\n%s\n", $_[0], join "\n", (map { "'$_'" } @up_to_N_lines[0..$max_lines - 1 ]), @up_to_N_lines > $max_lines ? '...' : () ); } } # # The "eofile" rule makes the parser fail if any "statement" rule # fails. Otherwise, the first successful match by a "statement" # won't cause the failure needed to know that the parse, as a whole, # failed. -ky # startrule : statement(s) eofile { $return = { tables => \%tables, views => \@views, triggers => \@triggers, } } eofile : /^\Z/ statement : begin_transaction | commit | drop | create | comment | /^\Z/ | { _err ($thisline, $text) } begin_transaction : /begin/i TRANSACTION(?) SEMICOLON commit : /commit/i SEMICOLON drop : /drop/i (tbl_drop | view_drop | trg_drop) SEMICOLON tbl_drop: TABLE table_name view_drop: VIEW if_exists(?) view_name trg_drop: TRIGGER if_exists(?) trigger_name comment : /^\s*(?:#|-{2}).*\n/ { my $comment = $item[1]; $comment =~ s/^\s*(#|-{2})\s*//; $comment =~ s/\s*$//; $return = $comment; } comment : /\/\*/ /[^\*]+/ /\*\// { my $comment = $item[2]; $comment =~ s/^\s*|\s*$//g; $return = $comment; } # # Create Index # create : CREATE TEMPORARY(?) UNIQUE(?) INDEX NAME ON table_name parens_field_list conflict_clause(?) SEMICOLON { my $db_name = $item[7]->{'db_name'} || ''; my $table_name = $item[7]->{'name'}; my $index = { name => $item[5], fields => $item[8], on_conflict => $item[9][0], is_temporary => $item[2][0] ? 1 : 0, }; my $is_unique = $item[3][0]; if ( $is_unique ) { $index->{'type'} = 'unique'; push @{ $tables{ $table_name }{'constraints'} }, $index; } else { push @{ $tables{ $table_name }{'indices'} }, $index; } } # # Create Table # create : comment(s?) CREATE TEMPORARY(?) TABLE table_name '(' definition(s /,/) ')' SEMICOLON { my $db_name = $item[5]->{'db_name'} || ''; my $table_name = $item[5]->{'name'}; $tables{ $table_name }{'name'} = $table_name; $tables{ $table_name }{'is_temporary'} = $item[3][0] ? 1 : 0; $tables{ $table_name }{'comments'} = $item[1]; $tables{ $table_name }{'order'} = ++$table_order; for my $def ( @{ $item[7] } ) { if ( $def->{'supertype'} eq 'column' ) { push @{ $tables{ $table_name }{'fields'} }, $def; } elsif ( $def->{'supertype'} eq 'constraint' ) { push @{ $tables{ $table_name }{'constraints'} }, $def; } } } definition : constraint_def | column_def column_def: comment(s?) NAME type(?) column_constraint_def(s?) { my $column = { supertype => 'column', name => $item[2], data_type => $item[3][0]->{'type'}, size => $item[3][0]->{'size'}, is_nullable => 1, is_primary_key => 0, is_unique => 0, check => '', default => undef, constraints => $item[4], comments => $item[1], }; for my $c ( @{ $item[4] } ) { if ( $c->{'type'} eq 'not_null' ) { $column->{'is_nullable'} = 0; } elsif ( $c->{'type'} eq 'primary_key' ) { $column->{'is_primary_key'} = 1; } elsif ( $c->{'type'} eq 'unique' ) { $column->{'is_unique'} = 1; } elsif ( $c->{'type'} eq 'check' ) { $column->{'check'} = $c->{'expression'}; } elsif ( $c->{'type'} eq 'default' ) { $column->{'default'} = $c->{'value'}; } elsif ( $c->{'type'} eq 'autoincrement' ) { $column->{'is_auto_inc'} = 1; } } $column; } type : WORD parens_value_list(?) { $return = { type => $item[1], size => $item[2][0], } } column_constraint_def : CONSTRAINT constraint_name column_constraint { $return = { name => $item[2], %{ $item[3] }, } } | column_constraint column_constraint : NOT_NULL conflict_clause(?) { $return = { type => 'not_null', } } | PRIMARY_KEY sort_order(?) conflict_clause(?) { $return = { type => 'primary_key', sort_order => $item[2][0], on_conflict => $item[2][0], } } | UNIQUE conflict_clause(?) { $return = { type => 'unique', on_conflict => $item[2][0], } } | CHECK_C '(' expr ')' conflict_clause(?) { $return = { type => 'check', expression => $item[3], on_conflict => $item[5][0], } } | DEFAULT VALUE { $return = { type => 'default', value => $item[2], } } | REFERENCES ref_def cascade_def(?) { $return = { type => 'foreign_key', reference_table => $item[2]{'reference_table'}, reference_fields => $item[2]{'reference_fields'}, on_delete => $item[3][0]{'on_delete'}, on_update => $item[3][0]{'on_update'}, } } | AUTOINCREMENT { $return = { type => 'autoincrement', } } constraint_def : comment(s?) CONSTRAINT constraint_name table_constraint { $return = { comments => $item[1], name => $item[3], %{ $item[4] }, } } | comment(s?) table_constraint { $return = { comments => $item[1], %{ $item[2] }, } } table_constraint : PRIMARY_KEY parens_field_list conflict_clause(?) { $return = { supertype => 'constraint', type => 'primary_key', fields => $item[2], on_conflict => $item[3][0], } } | UNIQUE parens_field_list conflict_clause(?) { $return = { supertype => 'constraint', type => 'unique', fields => $item[2], on_conflict => $item[3][0], } } | CHECK_C '(' expr ')' conflict_clause(?) { $return = { supertype => 'constraint', type => 'check', expression => $item[3], on_conflict => $item[5][0], } } | FOREIGN_KEY parens_field_list REFERENCES ref_def cascade_def(?) { $return = { supertype => 'constraint', type => 'foreign_key', fields => $item[2], reference_table => $item[4]{'reference_table'}, reference_fields => $item[4]{'reference_fields'}, on_delete => $item[5][0]{'on_delete'}, on_update => $item[5][0]{'on_update'}, } } ref_def : table_name parens_field_list { $return = { reference_table => $item[1]{name}, reference_fields => $item[2] } } cascade_def : cascade_update_def cascade_delete_def(?) { $return = { on_update => $item[1], on_delete => $item[2][0] } } | cascade_delete_def cascade_update_def(?) { $return = { on_delete => $item[1], on_update => $item[2][0] } } cascade_delete_def : /on\s+delete\s+(set null|set default|cascade|restrict|no action)/i { $return = $1} cascade_update_def : /on\s+update\s+(set null|set default|cascade|restrict|no action)/i { $return = $1} table_name : qualified_name qualified_name : NAME { $return = { name => $item[1] } } qualified_name : /(\w+)\.(\w+)/ { $return = { db_name => $1, name => $2 } } field_name : NAME constraint_name : NAME conflict_clause : /on conflict/i conflict_algorigthm conflict_algorigthm : /(rollback|abort|fail|ignore|replace)/i parens_field_list : '(' column_list ')' { $item[2] } column_list : field_name(s /,/) parens_value_list : '(' VALUE(s /,/) ')' { $item[2] } expr : /[^)]* \( [^)]+ \) [^)]*/x # parens, balanced one deep | /[^)]+/ sort_order : /(ASC|DESC)/i # # Create Trigger create : CREATE TEMPORARY(?) TRIGGER NAME before_or_after(?) database_event ON table_name trigger_action SEMICOLON { my $table_name = $item[8]->{'name'}; push @triggers, { name => $item[4], is_temporary => $item[2][0] ? 1 : 0, when => $item[5][0], instead_of => 0, db_events => [ $item[6] ], action => $item[9], on_table => $table_name, } } create : CREATE TEMPORARY(?) TRIGGER NAME instead_of database_event ON view_name trigger_action { my $table_name = $item[8]->{'name'}; push @triggers, { name => $item[4], is_temporary => $item[2][0] ? 1 : 0, when => undef, instead_of => 1, db_events => [ $item[6] ], action => $item[9], on_table => $table_name, } } database_event : /(delete|insert|update)/i database_event : /update of/i column_list trigger_action : for_each(?) when(?) BEGIN_C trigger_step(s) END_C { $return = { for_each => $item[1][0], when => $item[2][0], steps => $item[4], } } for_each : /FOR EACH ROW/i when : WHEN expr { $item[2] } string : /'(\.|''|[^\\'])*'/ nonstring : /[^;\'"]+/ statement_body : string | nonstring trigger_step : /(select|delete|insert|update)/i statement_body(s?) SEMICOLON { $return = join( ' ', $item[1], join ' ', @{ $item[2] || [] } ) } before_or_after : /(before|after)/i { $return = lc $1 } instead_of : /instead of/i if_exists : /if exists/i view_name : qualified_name trigger_name : qualified_name # # Create View # create : CREATE TEMPORARY(?) VIEW view_name AS select_statement { push @views, { name => $item[4]->{'name'}, sql => $item[6], is_temporary => $item[2][0] ? 1 : 0, } } select_statement : SELECT /[^;]+/ SEMICOLON { $return = join( ' ', $item[1], $item[2] ); } # # Tokens # BEGIN_C : /begin/i END_C : /end/i TRANSACTION: /transaction/i CREATE : /create/i TEMPORARY : /temp(orary)?/i { 1 } TABLE : /table/i INDEX : /index/i NOT_NULL : /not null/i PRIMARY_KEY : /primary key/i FOREIGN_KEY : /foreign key/i CHECK_C : /check/i DEFAULT : /default/i TRIGGER : /trigger/i VIEW : /view/i SELECT : /select/i ON : /on/i AS : /as/i WORD : /\w+/ WHEN : /when/i REFERENCES : /references/i CONSTRAINT : /constraint/i AUTOINCREMENT : /autoincrement/i UNIQUE : /unique/i { 1 } SEMICOLON : ';' NAME : /\w+/ | DQSTRING | SQSTRING DQSTRING : '"' /((?:[^"]|"")+)/ '"' { ($return = $item[3]) =~ s/""/"/g } SQSTRING : "'" /((?:[^']|'')*)/ "'" { ($return = $item[3]) =~ s/''/'/g } VALUE : /[-+]?\d*\.?\d+(?:[eE]\d+)?/ { $item[1] } | SQSTRING | /NULL/i { 'NULL' } | /CURRENT_TIMESTAMP/i { 'CURRENT_TIMESTAMP' } END_OF_GRAMMAR sub parse { my ($translator, $data) = @_; # Enable warnings within the Parse::RecDescent module. local $::RD_ERRORS = 1 unless defined $::RD_ERRORS; # Make sure the parser dies when it encounters an error local $::RD_WARN = 1 unless defined $::RD_WARN; # Enable warnings. This will warn on unused rules &c. local $::RD_HINT = 1 unless defined $::RD_HINT; # Give out hints to help fix problems. local $::RD_TRACE = $translator->trace ? 1 : undef; local $DEBUG = $translator->debug; my $parser = ddl_parser_instance('SQLite'); my $result = $parser->startrule($data); return $translator->error("Parse failed.") unless defined $result; warn Dumper($result) if $DEBUG; my $schema = $translator->schema; my @tables = map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [ $result->{'tables'}{$_}->{'order'}, $_ ] } keys %{ $result->{'tables'} }; for my $table_name (@tables) { my $tdata = $result->{'tables'}{$table_name}; my $table = $schema->add_table(name => $tdata->{'name'},) or die $schema->error; $table->comments($tdata->{'comments'}); for my $fdata (@{ $tdata->{'fields'} }) { my $field = $table->add_field( name => $fdata->{'name'}, data_type => $fdata->{'data_type'}, size => $fdata->{'size'}, default_value => $fdata->{'default'}, is_auto_increment => $fdata->{'is_auto_inc'}, ( $fdata->{'is_auto_inc'} ? (extra => { auto_increment_type => 'monotonic' }) : () ), is_nullable => $fdata->{'is_nullable'}, comments => $fdata->{'comments'}, ) or die $table->error; $table->primary_key($field->name) if $fdata->{'is_primary_key'}; for my $cdata (@{ $fdata->{'constraints'} }) { next unless $cdata->{'type'} eq 'foreign_key'; $cdata->{'fields'} ||= [ $field->name ]; push @{ $tdata->{'constraints'} }, $cdata; } } for my $idata (@{ $tdata->{'indices'} || [] }) { my $index = $table->add_index( name => $idata->{'name'}, type => uc($idata->{'type'} || ''), fields => $idata->{'fields'}, ) or die $table->error; } for my $cdata (@{ $tdata->{'constraints'} || [] }) { my $constraint = $table->add_constraint( name => $cdata->{'name'}, type => $cdata->{'type'}, fields => $cdata->{'fields'}, reference_table => $cdata->{'reference_table'}, reference_fields => $cdata->{'reference_fields'}, match_type => $cdata->{'match_type'} || '', on_delete => $cdata->{'on_delete'} || $cdata->{'on_delete_do'}, on_update => $cdata->{'on_update'} || $cdata->{'on_update_do'}, ) or die $table->error; } } for my $def (@{ $result->{'views'} || [] }) { my $view = $schema->add_view( name => $def->{'name'}, sql => $def->{'sql'}, ); } for my $def (@{ $result->{'triggers'} || [] }) { my $view = $schema->add_trigger( name => $def->{'name'}, perform_action_when => $def->{'when'}, database_events => $def->{'db_events'}, action => $def->{'action'}, on_table => $def->{'on_table'}, scope => 'row', # SQLite only supports row triggers ); } return 1; } 1; # ------------------------------------------------------------------- # All wholesome food is caught without a net or a trap. # William Blake # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =head1 SEE ALSO perl(1), Parse::RecDescent, SQL::Translator::Schema. =cut SQL-Translator-1.66/lib/SQL/Translator/Parser.pm0000644000000000000000000000273714716630117021401 0ustar00rootroot00000000000000package SQL::Translator::Parser; use strict; use warnings; our $VERSION = '1.66'; sub parse {""} 1; # ---------------------------------------------------------------------- # Enough! or Too much. # William Blake # ---------------------------------------------------------------------- =pod =head1 NAME SQL::Translator::Parser - describes how to write a parser =head1 DESCRIPTION Parser modules that get invoked by SQL::Translator need to implement a single function: B. This function will be called by the SQL::Translator instance as $class::parse($tr, $data_as_string), where $tr is a SQL::Translator instance. Other than that, the classes are free to define any helper functions, or use any design pattern internally that make the most sense. When the parser has determined what exists, it will communicate the structure to the producer through the SQL::Translator::Schema object. This object can be retrieved from the translator (the first argument pass to B) by calling the B method: my $schema = $tr->schema; The Schema object has methods for adding tables, fields, indices, etc. For more information, consult the docs for SQL::Translator::Schema and its related modules. For examples of how this works, examine the source code for existing SQL::Translator::Parser::* modules. =head1 AUTHORS Ken Youens-Clark, Ekclark@cpan.org, darren chamberlain Edarren@cpan.orgE. =head1 SEE ALSO perl(1), SQL::Translator, SQL::Translator::Schema. =cut SQL-Translator-1.66/lib/SQL/Translator/Producer/0000755000000000000000000000000014716630506021363 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Producer/ClassDBI.pm0000644000000000000000000002750714716630117023316 0ustar00rootroot00000000000000package SQL::Translator::Producer::ClassDBI; use strict; use warnings; our $DEBUG; our $VERSION = '1.66'; $DEBUG = 1 unless defined $DEBUG; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(debug header_comment); use Data::Dumper; my %CDBI_auto_pkgs = ( MySQL => 'mysql', PostgreSQL => 'Pg', Oracle => 'Oracle', ); sub produce { my $t = shift; local $DEBUG = $t->debug; my $no_comments = $t->no_comments; my $schema = $t->schema; my $args = $t->producer_args; my @create; if (my $fmt = $args->{'format_pkg_name'}) { $t->format_package_name($fmt); } if (my $fmt = $args->{'format_fk_name'}) { $t->format_fk_name($fmt); } my $db_user = $args->{'db_user'} || ''; my $db_pass = $args->{'db_password'} || ''; my $main_pkg_name = $args->{'package_name'} || # $args->{'main_pkg_name'} || # keep this? undocumented $t->format_package_name('DBI'); my $header = header_comment(__PACKAGE__, "# "); my $parser_type = (split /::/, $t->parser_type)[-1]; my $from = $CDBI_auto_pkgs{$parser_type} || ''; my $dsn = $args->{'dsn'} || sprintf( 'dbi:%s:_', $CDBI_auto_pkgs{$parser_type} ? $CDBI_auto_pkgs{$parser_type} : $parser_type ); my $sep = '# ' . '-' x 67; # # Identify "link tables" (have only PK and FK fields). # my %linkable; my %linktable; for my $table ($schema->get_tables) { debug("PKG: Table = ", $table->name, "\n"); my $is_link = 1; for my $field ($table->get_fields) { unless ($field->is_primary_key or $field->is_foreign_key) { $is_link = 0; last; } } next unless $is_link; foreach my $left ($table->get_fields) { next unless $left->is_foreign_key; my $lfk = $left->foreign_key_reference or next; my $lr_table = $schema->get_table($lfk->reference_table) or next; my $lr_field_name = ($lfk->reference_fields)[0]; my $lr_field = $lr_table->get_field($lr_field_name); next unless $lr_field->is_primary_key; foreach my $right ($table->get_fields) { next if $left->name eq $right->name; my $rfk = $right->foreign_key_reference or next; my $rr_table = $schema->get_table($rfk->reference_table) or next; my $rr_field_name = ($rfk->reference_fields)[0]; my $rr_field = $rr_table->get_field($rr_field_name); next unless $rr_field->is_primary_key; $linkable{ $lr_table->name }{ $rr_table->name } = $table; $linkable{ $rr_table->name }{ $lr_table->name } = $table; $linktable{ $table->name } = $table; } } } # # Iterate over all tables # my (%packages, $order); for my $table ($schema->get_tables) { my $table_name = $table->name or next; my $table_pkg_name = join '::', $main_pkg_name, $t->format_package_name($table_name); $packages{$table_pkg_name} = { order => ++$order, pkg_name => $table_pkg_name, base => $main_pkg_name, table => $table_name, }; # # Primary key may have a different accessor method name # # if ( my $constraint = $table->primary_key ) { # my $field = ( $constraint->fields )[0]; # $packages{ $table_pkg_name }{'_columns_primary'} = $field; # # if ( my $pk_xform = $t->format_pk_name ) { # my $pk_name = $pk_xform->( $table_pkg_name, $field ); # # $packages{$table_pkg_name}{'pk_accessor'} = # "#\n# Primary key accessor\n#\n" # . "sub $pk_name {\n shift->$field\n}\n\n"; # } # } my $is_data = 0; foreach my $field ($table->get_fields) { if (!$field->is_foreign_key and !$field->is_primary_key) { push @{ $packages{$table_pkg_name}{'_columns_essential'} }, $field->name; $is_data++; } elsif (!$field->is_primary_key) { push @{ $packages{$table_pkg_name}{'_columns_others'} }, $field->name; } } my %linked; if ($is_data) { foreach my $link (keys %{ $linkable{$table_name} }) { my $linkmethodname; if (my $fk_xform = $t->format_fk_name) { # ADD CALLBACK FOR PLURALIZATION MANGLING HERE $linkmethodname = $fk_xform->($linkable{$table_name}{$link}->name, ($schema->get_table($link)->primary_key->fields)[0]) . 's'; } else { # ADD CALLBACK FOR PLURALIZATION MANGLING HERE $linkmethodname = $linkable{$table_name}{$link}->name . '_' . ($schema->get_table($link)->primary_key->fields)[0] . 's'; } my @rk_fields = (); my @lk_fields = (); foreach my $field ($linkable{$table_name}{$link}->get_fields) { next unless $field->is_foreign_key; next unless ($field->foreign_key_reference->reference_table eq $table_name || $field->foreign_key_reference->reference_table eq $link); push @lk_fields, ($field->foreign_key_reference->reference_fields)[0] if $field->foreign_key_reference->reference_table eq $link; push @rk_fields, $field->name if $field->foreign_key_reference->reference_table eq $table_name; } # # If one possible traversal via link table. # if (scalar(@rk_fields) == 1 and scalar(@lk_fields) == 1) { foreach my $rk_field (@rk_fields) { push @{ $packages{$table_pkg_name}{'has_many'}{$link} }, "sub " . $linkmethodname . " { my \$self = shift; " . "return map \$_->" . ($schema->get_table($link)->primary_key->fields)[0] . ", \$self->" . $linkable{$table_name}{$link}->name . "_" . $rk_field . " }\n\n"; } # # Else there is more than one way to traverse it. # ack! Let's treat these types of link tables as # a many-to-one (easier) # # NOTE: we need to rethink the link method name, # as the cardinality has shifted on us. # } elsif (scalar(@rk_fields) == 1) { foreach my $rk_field (@rk_fields) { # # ADD CALLBACK FOR PLURALIZATION MANGLING HERE # push @{ $packages{$table_pkg_name}{'has_many'}{$link} }, "sub " . $linkable{$table_name}{$link}->name . "s { my \$self = shift; return \$self->" . $linkable{$table_name}{$link}->name . "_" . $rk_field . "(\@_) }\n\n"; } } elsif (scalar(@lk_fields) == 1) { # # These will be taken care of on the other end... # } else { # # Many many many. Need multiple iterations here, # data structure revision to handle N FK sources. # This code has not been tested and likely doesn't # work here. # foreach my $rk_field (@rk_fields) { # ADD CALLBACK FOR PLURALIZATION MANGLING HERE push @{ $packages{$table_pkg_name}{'has_many'}{$link} }, "sub " . $linkable{$table_name}{$link}->name . "_" . $rk_field . "s { my \$self = shift; return \$self->" . $linkable{$table_name}{$link}->name . "_" . $rk_field . "(\@_) }\n\n"; } } } } # # Use foreign keys to set up "has_a/has_many" relationships. # foreach my $field ($table->get_fields) { if ($field->is_foreign_key) { my $table_name = $table->name; my $field_name = $field->name; # my $fk_method = $t->format_fk_name( $table_name, $field_name ); my $fk_method = join('::', $table_pkg_name, $t->format_fk_name($table_name, $field_name)); my $fk = $field->foreign_key_reference; my $ref_table = $fk->reference_table; my $ref_pkg = $t->format_package_name($ref_table); my $ref_field = ($fk->reference_fields)[0]; # my $fk_method = join('::', # $table_pkg_name, $t->format_fk_name( $ref_table ) # ); push @{ $packages{$table_pkg_name}{'has_a'} }, "$table_pkg_name->has_a(\n" . " $field_name => '$ref_pkg'\n);\n\n" . "sub $fk_method {\n" . " return shift->$field_name\n}\n\n"; # if there weren't M-M relationships via the has_many # being set up here, create nice pluralized method alias # rather for user as alt. to ugly tablename_fieldname name # # if ( !$packages{$ref_pkg}{'has_many'}{$table_name} ) { # # # # ADD CALLBACK FOR PLURALIZATION MANGLING HERE # # # push @{ $packages{$ref_pkg}{'has_many'}{$table_name} }, # "sub ${table_name}s {\n " . # "return shift->$table_name\_$field_name\n}\n\n"; # # else ugly # } # else { # } push @{ $packages{$ref_pkg}{'has_many'}{$table_name} }, "$ref_pkg->has_many(\n '${table_name}_${field_name}', " . "'$table_pkg_name' => '$field_name'\n);\n\n"; } } } # # Now build up text of package. # my $base_pkg = sprintf('Class::DBI%s', $from ? "::$from" : ''); push @create, join("\n", "package $main_pkg_name;\n", $header, "use strict;", "use base '$base_pkg';\n", "$main_pkg_name->set_db('Main', '$dsn', '$db_user', '$db_pass');\n\n", ); for my $pkg_name ( sort { $packages{$a}{'order'} <=> $packages{$b}{'order'} } keys %packages ) { my $pkg = $packages{$pkg_name} or next; next unless $pkg->{'pkg_name'}; push @create, join("\n", $sep, "package " . $pkg->{'pkg_name'} . ";", "use base '" . $pkg->{'base'} . "';", "use Class::DBI::Pager;\n\n", ); if ($from) { push @create, join('', $pkg->{'pkg_name'}, "->set_up_table('", $pkg->{'table'}, "');\n\n"); } else { my $table = $schema->get_table($pkg->{'table'}); my @field_names = map { $_->name } $table->get_fields; push @create, join("\n", $pkg_name . "->table('" . $pkg->{'table'} . "');\n", $pkg_name . "->columns(All => qw/" . join(' ', @field_names) . "/);\n\n", ); } push @create, "\n"; if (my $pk = $pkg->{'pk_accessor'}) { push @create, $pk; } if (my @has_a = @{ $pkg->{'has_a'} || [] }) { push @create, $_ for @has_a; } foreach my $has_many_key (keys %{ $pkg->{'has_many'} }) { if (my @has_many = @{ $pkg->{'has_many'}{$has_many_key} || [] }) { push @create, $_ for @has_many; } } } push @create, "1;\n"; return wantarray ? @create : join('', @create); } 1; =pod =head1 NAME SQL::Translator::Producer::ClassDBI - create Class::DBI classes from schema =head1 SYNOPSIS Use this producer as you would any other from SQL::Translator. See L for details. This package uses SQL::Translator's formatting methods format_package_name(), format_pk_name(), format_fk_name(), and format_table_name() as it creates classes, one per table in the schema provided. An additional base class is also created for database connectivity configuration. See L for details on how this works. =head1 AUTHORS Allen Day Eallenday@ucla.eduE, Ying Zhang Ezyolive@yahoo.comE, Ken Youens-Clark Ekclark@cpan.orgE. SQL-Translator-1.66/lib/SQL/Translator/Producer/JSON.pm0000644000000000000000000001325214716630117022473 0ustar00rootroot00000000000000package SQL::Translator::Producer::JSON; =head1 NAME SQL::Translator::Producer::JSON - A JSON producer for SQL::Translator =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new(producer => 'JSON'); =head1 DESCRIPTION This module serializes a schema to a JSON string. =cut use strict; use warnings; our $VERSION = '1.66'; use JSON::MaybeXS 'to_json'; sub produce { my $translator = shift; my $schema = $translator->schema; return to_json( { schema => { tables => { map { ($_->name => view_table($_)) } $schema->get_tables, }, views => { map { ($_->name => view_view($_)) } $schema->get_views, }, triggers => { map { ($_->name => view_trigger($_)) } $schema->get_triggers, }, procedures => { map { ($_->name => view_procedure($_)) } $schema->get_procedures, }, }, translator => { add_drop_table => $translator->add_drop_table, filename => $translator->filename, no_comments => $translator->no_comments, parser_args => $translator->parser_args, producer_args => $translator->producer_args, parser_type => $translator->parser_type, producer_type => $translator->producer_type, show_warnings => $translator->show_warnings, trace => $translator->trace, version => $translator->version, }, keys %{ $schema->extra } ? ('extra' => { $schema->extra }) : (), }, { allow_blessed => 1, allow_unknown => 1, ( map { $_ => $translator->producer_args->{$_} } grep { defined $translator->producer_args->{$_} } qw[ pretty indent canonical ] ), } ); } sub view_table { my $table = shift; return { 'name' => $table->name, 'order' => $table->order, 'options' => $table->options || [], $table->comments ? ('comments' => [ $table->comments ]) : (), 'constraints' => [ map { view_constraint($_) } $table->get_constraints ], 'indices' => [ map { view_index($_) } $table->get_indices ], 'fields' => { map { ($_->name => view_field($_)) } $table->get_fields }, keys %{ $table->extra } ? ('extra' => { $table->extra }) : (), }; } sub view_constraint { my $constraint = shift; return { 'deferrable' => scalar $constraint->deferrable, 'expression' => scalar $constraint->expression, 'fields' => [ map { ref $_ ? $_->name : $_ } $constraint->field_names ], 'match_type' => scalar $constraint->match_type, 'name' => scalar $constraint->name, 'options' => scalar $constraint->options, 'on_delete' => scalar $constraint->on_delete, 'on_update' => scalar $constraint->on_update, 'reference_fields' => [ map { ref $_ ? $_->name : $_ } $constraint->reference_fields ], 'reference_table' => scalar $constraint->reference_table, 'type' => scalar $constraint->type, keys %{ $constraint->extra } ? ('extra' => { $constraint->extra }) : (), }; } sub view_field { my $field = shift; return { 'order' => scalar $field->order, 'name' => scalar $field->name, 'data_type' => scalar $field->data_type, 'size' => [ $field->size ], 'default_value' => scalar $field->default_value, 'is_nullable' => scalar $field->is_nullable, 'is_primary_key' => scalar $field->is_primary_key, 'is_unique' => scalar $field->is_unique, $field->is_auto_increment ? ('is_auto_increment' => 1) : (), $field->comments ? ('comments' => [ $field->comments ]) : (), keys %{ $field->extra } ? ('extra' => { $field->extra }) : (), }; } sub view_procedure { my $procedure = shift; return { 'order' => scalar $procedure->order, 'name' => scalar $procedure->name, 'sql' => scalar $procedure->sql, 'parameters' => scalar $procedure->parameters, 'owner' => scalar $procedure->owner, $procedure->comments ? ('comments' => [ $procedure->comments ]) : (), keys %{ $procedure->extra } ? ('extra' => { $procedure->extra }) : (), }; } sub view_trigger { my $trigger = shift; return { 'order' => scalar $trigger->order, 'name' => scalar $trigger->name, 'perform_action_when' => scalar $trigger->perform_action_when, 'database_events' => scalar $trigger->database_events, 'fields' => scalar $trigger->fields, 'on_table' => scalar $trigger->on_table, 'action' => scalar $trigger->action, ( defined $trigger->scope ? ('scope' => scalar $trigger->scope,) : () ), keys %{ $trigger->extra } ? ('extra' => { $trigger->extra }) : (), }; } sub view_view { my $view = shift; return { 'order' => scalar $view->order, 'name' => scalar $view->name, 'sql' => scalar $view->sql, 'fields' => scalar $view->fields, keys %{ $view->extra } ? ('extra' => { $view->extra }) : (), }; } sub view_index { my $index = shift; return { 'name' => scalar $index->name, 'type' => scalar $index->type, 'fields' => [ map { ref($_) && $_->extra && keys %{ $_->extra } ? { name => $_->name, %{ $_->extra } } : "$_" } $index->fields ], 'options' => scalar $index->options, keys %{ $index->extra } ? ('extra' => { $index->extra }) : (), }; } 1; =head1 SEE ALSO SQL::Translator, JSON::MaybeXS, http://www.json.org/. =head1 AUTHORS darren chamberlain Edarren@cpan.orgE, Ken Youens-Clark Ekclark@cpan.orgE. Jon Jensen Ejonj@cpan.orgE. =cut SQL-Translator-1.66/lib/SQL/Translator/Producer/MySQL.pm0000644000000000000000000006461314716630117022676 0ustar00rootroot00000000000000package SQL::Translator::Producer::MySQL; =head1 NAME SQL::Translator::Producer::MySQL - MySQL-specific producer for SQL::Translator =head1 SYNOPSIS Use via SQL::Translator: use SQL::Translator; my $t = SQL::Translator->new( parser => '...', producer => 'MySQL', '...' ); $t->translate; =head1 DESCRIPTION This module will produce text output of the schema suitable for MySQL. There are still some issues to be worked out with syntax differences between MySQL versions 3 and 4 ("SET foreign_key_checks," character sets for fields, etc.). =head1 ARGUMENTS This producer takes a single optional producer_arg C, which provides the desired version for the target database. By default MySQL v3 is assumed, and statements pertaining to any features introduced in later versions (e.g. CREATE VIEW) are not produced. Valid version specifiers for C are listed L =head2 Table Types Normally the tables will be created without any explicit table type given and so will use the MySQL default. Any tables involved in foreign key constraints automatically get a table type of InnoDB, unless this is overridden by setting the C extra attribute explicitly on the table. =head2 Extra attributes. The producer recognises the following extra attributes on the Schema objects. =over 4 =item B Set the list of allowed values for Enum fields. =item B, B, B Set the MySQL field options of the same name. =item B, B Use when producing diffs to indicate that the current table/field has been renamed from the old name as given in the attribute value. =item B Set the type of the table e.g. 'InnoDB', 'MyISAM'. This will be automatically set for tables involved in foreign key constraints if it is not already set explicitly. See L<"Table Types">. Please note that the C option is the preferred method of specifying the MySQL storage engine to use, but this method still works for backwards compatibility. =item B, B Set the tables default character set and collation order. =item B, B Set the fields character set and collation order. =back =cut use strict; use warnings; our ($DEBUG, %used_names); our $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; # Maximum length for most identifiers is 64, according to: # http://dev.mysql.com/doc/refman/4.1/en/identifiers.html # http://dev.mysql.com/doc/refman/5.0/en/identifiers.html my $DEFAULT_MAX_ID_LENGTH = 64; use base qw(SQL::Translator::Producer); use Data::Dumper; use SQL::Translator::Schema::Constants; use SQL::Translator::Generator::DDL::MySQL; use SQL::Translator::Utils qw(debug header_comment truncate_id_uniquely parse_mysql_version batch_alter_table_statements normalize_quote_options ); # # Use only lowercase for the keys (e.g. "long" and not "LONG") # my %translate = ( # # Oracle types # varchar2 => 'varchar', long => 'text', clob => 'longtext', # # Sybase types # int => 'integer', money => 'float', real => 'double', comment => 'text', bit => 'tinyint', # # Access types # 'long integer' => 'integer', 'text' => 'text', 'datetime' => 'datetime', # # PostgreSQL types # bytea => 'BLOB', ); # # Column types that do not support length attribute # my @no_length_attr = qw/ date time timestamp datetime year /; sub preprocess_schema { my ($schema) = @_; # extra->{mysql_table_type} used to be the type. It belongs in options, so # move it if we find it. Return Engine type if found in extra or options # Similarly for mysql_charset and mysql_collate my $extra_to_options = sub { my ($table, $extra_name, $opt_name) = @_; my $extra = $table->extra; my $extra_type = delete $extra->{$extra_name}; # Now just to find if there is already an Engine or Type option... # and lets normalize it to ENGINE since: # # The ENGINE table option specifies the storage engine for the table. # TYPE is a synonym, but ENGINE is the preferred option name. # my $options = $table->options; # If multiple option names, normalize to the first one if (ref $opt_name) { OPT_NAME: for (@$opt_name[ 1 .. $#$opt_name ]) { for my $idx (0 .. $#{$options}) { my ($key, $value) = %{ $options->[$idx] }; if (uc $key eq $_) { $options->[$idx] = { $opt_name->[0] => $value }; last OPT_NAME; } } } $opt_name = $opt_name->[0]; } # This assumes that there isn't both a Type and an Engine option. OPTION: for my $idx (0 .. $#{$options}) { my ($key, $value) = %{ $options->[$idx] }; next unless uc $key eq $opt_name; # make sure case is right on option name delete $options->[$idx]{$key}; return $options->[$idx]{$opt_name} = $value || $extra_type; } if ($extra_type) { push @$options, { $opt_name => $extra_type }; return $extra_type; } }; # Names are only specific to a given schema local %used_names = (); # # Work out which tables need to be InnoDB to support foreign key # constraints. We do this first as we need InnoDB at both ends. # foreach my $table ($schema->get_tables) { $extra_to_options->($table, 'mysql_table_type', [ 'ENGINE', 'TYPE' ]); $extra_to_options->($table, 'mysql_charset', 'CHARACTER SET'); $extra_to_options->($table, 'mysql_collate', 'COLLATE'); foreach my $c ($table->get_constraints) { next unless $c->type eq FOREIGN_KEY; # Normalize constraint names here. my $c_name = $c->name; # Give the constraint a name if it doesn't have one, so it doesn't feel # left out $c_name = $table->name . '_fk' unless length $c_name; $c->name(next_unused_name($c_name)); for my $meth (qw/table reference_table/) { my $table = $schema->get_table($c->$meth) || next; # This normalizes the types to ENGINE and returns the value if its there next if $extra_to_options->($table, 'mysql_table_type', [ 'ENGINE', 'TYPE' ]); $table->options({ 'ENGINE' => 'InnoDB' }); } } # foreach constraints my %map = (mysql_collate => 'collate', mysql_charset => 'character set'); foreach my $f ($table->get_fields) { my $extra = $f->extra; for (keys %map) { $extra->{ $map{$_} } = delete $extra->{$_} if exists $extra->{$_}; } my @size = $f->size; if (!$size[0] && $f->data_type =~ /char$/) { $f->size((255)); } } } } { my ($quoting_generator, $nonquoting_generator); sub _generator { my $options = shift; return $options->{generator} if exists $options->{generator}; return normalize_quote_options($options) ? $quoting_generator ||= SQL::Translator::Generator::DDL::MySQL->new() : $nonquoting_generator ||= SQL::Translator::Generator::DDL::MySQL->new(quote_chars => [],); } } sub produce { my $translator = shift; local $DEBUG = $translator->debug; local %used_names; my $no_comments = $translator->no_comments; my $add_drop_table = $translator->add_drop_table; my $schema = $translator->schema; my $show_warnings = $translator->show_warnings || 0; my $producer_args = $translator->producer_args; my $mysql_version = parse_mysql_version($producer_args->{mysql_version}, 'perl') || 0; my $max_id_length = $producer_args->{mysql_max_id_length} || $DEFAULT_MAX_ID_LENGTH; my $generator = _generator({ quote_identifiers => $translator->quote_identifiers }); debug("PKG: Beginning production\n"); %used_names = (); my $create = ''; $create .= header_comment unless ($no_comments); # \todo Don't set if MySQL 3.x is set on command line my @create = "SET foreign_key_checks=0"; preprocess_schema($schema); # # Generate sql # my @table_defs = (); for my $table ($schema->get_tables) { # print $table->name, "\n"; push @table_defs, create_table( $table, { add_drop_table => $add_drop_table, show_warnings => $show_warnings, no_comments => $no_comments, generator => $generator, max_id_length => $max_id_length, mysql_version => $mysql_version } ); } if ($mysql_version >= 5.000001) { for my $view ($schema->get_views) { push @table_defs, create_view( $view, { add_replace_view => $add_drop_table, show_warnings => $show_warnings, no_comments => $no_comments, generator => $generator, max_id_length => $max_id_length, mysql_version => $mysql_version } ); } } if ($mysql_version >= 5.000002) { for my $trigger ($schema->get_triggers) { push @table_defs, create_trigger( $trigger, { add_drop_trigger => $add_drop_table, show_warnings => $show_warnings, no_comments => $no_comments, generator => $generator, max_id_length => $max_id_length, mysql_version => $mysql_version } ); } } # print "@table_defs\n"; push @table_defs, "SET foreign_key_checks=1"; return wantarray ? ($create ? $create : (), @create, @table_defs) : ($create . join('', map { $_ ? "$_;\n\n" : () } (@create, @table_defs))); } sub create_trigger { my ($trigger, $options) = @_; my $generator = _generator($options); my $trigger_name = $trigger->name; debug("PKG: Looking at trigger '${trigger_name}'\n"); my @statements; my $events = $trigger->database_events; for my $event (@$events) { my $name = $trigger_name; if (@$events > 1) { $name .= "_$event"; warn "Multiple database events supplied for trigger '${trigger_name}', ", "creating trigger '${name}' for the '${event}' event\n" if $options->{show_warnings}; } my $action = $trigger->action; if ($action !~ /^ \s* BEGIN [\s\;] .*? [\s\;] END [\s\;]* $/six) { $action .= ";" unless $action =~ /;\s*\z/; $action = "BEGIN $action END"; } push @statements, "DROP TRIGGER IF EXISTS " . $generator->quote($name) if $options->{add_drop_trigger}; push @statements, sprintf( "CREATE TRIGGER %s %s %s ON %s\n FOR EACH ROW %s", $generator->quote($name), $trigger->perform_action_when, $event, $generator->quote($trigger->on_table), $action, ); } # Tack the comment onto the first statement $statements[0] = "--\n-- Trigger " . $generator->quote($trigger_name) . "\n--\n" . $statements[0] unless $options->{no_comments}; return @statements; } sub create_view { my ($view, $options) = @_; my $generator = _generator($options); my $view_name = $view->name; my $view_name_qt = $generator->quote($view_name); debug("PKG: Looking at view '${view_name}'\n"); # Header. Should this look like what mysqldump produces? my $create = ''; $create .= "--\n-- View: $view_name_qt\n--\n" unless $options->{no_comments}; $create .= 'CREATE'; $create .= ' OR REPLACE' if $options->{add_replace_view}; $create .= "\n"; my $extra = $view->extra; # ALGORITHM if (exists($extra->{mysql_algorithm}) && defined(my $algorithm = $extra->{mysql_algorithm})) { $create .= " ALGORITHM = ${algorithm}\n" if $algorithm =~ /(?:UNDEFINED|MERGE|TEMPTABLE)/i; } # DEFINER if (exists($extra->{mysql_definer}) && defined(my $user = $extra->{mysql_definer})) { $create .= " DEFINER = ${user}\n"; } # SECURITY if (exists($extra->{mysql_security}) && defined(my $security = $extra->{mysql_security})) { $create .= " SQL SECURITY ${security}\n" if $security =~ /(?:DEFINER|INVOKER)/i; } #Header, cont. $create .= " VIEW $view_name_qt"; if (my @fields = $view->fields) { my $list = join ', ', map { $generator->quote($_) } @fields; $create .= " ( ${list} )"; } if (my $sql = $view->sql) { # do not wrap parenthesis around the selector, mysql doesn't like this # http://bugs.mysql.com/bug.php?id=9198 $create .= " AS\n ${sql}\n"; } # $create .= ""; return $create; } sub create_table { my ($table, $options) = @_; my $generator = _generator($options); my $table_name = $generator->quote($table->name); debug("PKG: Looking at table '$table_name'\n"); # # Header. Should this look like what mysqldump produces? # my $create = ''; my $drop; $create .= "--\n-- Table: $table_name\n--\n" unless $options->{no_comments}; $drop = qq[DROP TABLE IF EXISTS $table_name] if $options->{add_drop_table}; $create .= "CREATE TABLE $table_name (\n"; # # Fields # my @field_defs; for my $field ($table->get_fields) { push @field_defs, create_field($field, $options); } # # Indices # my @index_defs; my %indexed_fields; for my $index ($table->get_indices) { push @index_defs, create_index($index, $options); $indexed_fields{$_} = 1 for $index->fields; } # # Constraints -- need to handle more than just FK. -ky # my @constraint_defs; my @constraints = $table->get_constraints; for my $c (@constraints) { my $constr = create_constraint($c, $options); push @constraint_defs, $constr if ($constr); unless ($indexed_fields{ ($c->fields())[0] } || $c->type ne FOREIGN_KEY) { push @index_defs, "INDEX (" . $generator->quote(($c->fields())[0]) . ")"; $indexed_fields{ ($c->fields())[0] } = 1; } } $create .= join(",\n", map {" $_"} @field_defs, @index_defs, @constraint_defs); # # Footer # $create .= "\n)"; $create .= generate_table_options($table, $options) || ''; # $create .= ";\n\n"; return $drop ? ($drop, $create) : $create; } sub generate_table_options { my ($table, $options) = @_; my $create; my $table_type_defined = 0; my $generator = _generator($options); my $charset = $table->extra('mysql_charset'); my $collate = $table->extra('mysql_collate'); my $union = undef; for my $t1_option_ref ($table->options) { my ($key, $value) = %{$t1_option_ref}; $table_type_defined = 1 if uc $key eq 'ENGINE' or uc $key eq 'TYPE'; if (uc $key eq 'CHARACTER SET') { $charset = $value; next; } elsif (uc $key eq 'COLLATE') { $collate = $value; next; } elsif (uc $key eq 'UNION') { $union = '(' . join(', ', map { $generator->quote($_) } @$value) . ')'; next; } $create .= " $key=$value"; } my $mysql_table_type = $table->extra('mysql_table_type'); $create .= " ENGINE=$mysql_table_type" if $mysql_table_type && !$table_type_defined; my $comments = $table->comments; $create .= " DEFAULT CHARACTER SET $charset" if $charset; $create .= " COLLATE $collate" if $collate; $create .= " UNION=$union" if $union; $create .= qq[ comment='$comments'] if $comments; return $create; } sub create_field { my ($field, $options) = @_; my $generator = _generator($options); my $field_name = $field->name; debug("PKG: Looking at field '$field_name'\n"); my $field_def = $generator->quote($field_name); # data type and size my $data_type = $field->data_type; my @size = $field->size; my %extra = $field->extra; my $list = $extra{'list'} || []; my $commalist = join(', ', map { __PACKAGE__->_quote_string($_) } @$list); my $charset = $extra{'mysql_charset'}; my $collate = $extra{'mysql_collate'}; my $mysql_version = $options->{mysql_version} || 0; # # Oracle "number" type -- figure best MySQL type # if (lc $data_type eq 'number') { # not an integer if (scalar @size > 1) { $data_type = 'double'; } elsif ($size[0] && $size[0] >= 12) { $data_type = 'bigint'; } elsif ($size[0] && $size[0] <= 1) { $data_type = 'tinyint'; } else { $data_type = 'int'; } } # # Convert a large Oracle varchar to "text" # (not necessary as of 5.0.3 http://dev.mysql.com/doc/refman/5.0/en/char.html) # elsif ($data_type =~ /char/i && $size[0] > 255) { unless ($size[0] <= 65535 && $mysql_version >= 5.000003) { $data_type = 'text'; @size = (); } } elsif ($data_type =~ /boolean/i) { if ($mysql_version >= 4) { $data_type = 'boolean'; } else { $data_type = 'enum'; $commalist = "'0','1'"; } } elsif (exists $translate{ lc $data_type }) { $data_type = $translate{ lc $data_type }; } @size = () if $data_type =~ /(text|blob)/i; if ($data_type =~ /(double|float)/ && scalar @size == 1) { push @size, '0'; } $field_def .= " $data_type"; if (lc($data_type) eq 'enum' || lc($data_type) eq 'set') { $field_def .= '(' . $commalist . ')'; } elsif (defined $size[0] && $size[0] > 0 && !grep lc($data_type) eq $_, @no_length_attr) { $field_def .= '(' . join(', ', @size) . ')'; } # char sets $field_def .= " CHARACTER SET $charset" if $charset; $field_def .= " COLLATE $collate" if $collate; # MySQL qualifiers for my $qual (qw[ binary unsigned zerofill ]) { my $val = $extra{$qual} || $extra{ uc $qual } or next; $field_def .= " $qual"; } for my $qual ('character set', 'collate', 'on update') { my $val = $extra{$qual} || $extra{ uc $qual } or next; if (ref $val) { $field_def .= " $qual ${$val}"; } else { $field_def .= " $qual $val"; } } # Null? if ($field->is_nullable) { $field_def .= ' NULL'; } else { $field_def .= ' NOT NULL'; } # Default? __PACKAGE__->_apply_default_value( $field, \$field_def, [ 'NULL' => \'NULL', ], ); if (my $comments = $field->comments) { $comments = __PACKAGE__->_quote_string($comments); $field_def .= qq[ comment $comments]; } # auto_increment? $field_def .= " auto_increment" if $field->is_auto_increment; return $field_def; } sub _quote_string { my ($self, $string) = @_; $string =~ s/([\\'])/$1$1/g; return qq{'$string'}; } sub alter_create_index { my ($index, $options) = @_; my $table_name = _generator($options)->quote($index->table->name); return join(' ', 'ALTER TABLE', $table_name, 'ADD', create_index(@_)); } sub create_index { my ($index, $options) = @_; my $generator = _generator($options); my @fields; for my $field ($index->fields) { my $name = $generator->quote($field->name); if (my $len = $field->extra->{prefix_length}) { $name .= "($len)"; } push @fields, $name; } return join(' ', map { $_ || () } lc $index->type eq 'normal' ? 'INDEX' : $index->type . ' INDEX', $index->name ? $generator->quote(truncate_id_uniquely($index->name, $options->{max_id_length} || $DEFAULT_MAX_ID_LENGTH)) : '', '(' . join(', ', @fields) . ')'); } sub alter_drop_index { my ($index, $options) = @_; my $table_name = _generator($options)->quote($index->table->name); return join(' ', 'ALTER TABLE', $table_name, 'DROP', 'INDEX', $index->name || $index->fields); } sub alter_drop_constraint { my ($c, $options) = @_; my $generator = _generator($options); my $table_name = $generator->quote($c->table->name); my @out = ('ALTER', 'TABLE', $table_name, 'DROP'); if ($c->type eq PRIMARY_KEY) { push @out, $c->type; } else { push @out, ($c->type eq FOREIGN_KEY ? $c->type : "CONSTRAINT"), $generator->quote($c->name); } return join(' ', @out); } sub alter_create_constraint { my ($index, $options) = @_; my $table_name = _generator($options)->quote($index->table->name); return join(' ', 'ALTER TABLE', $table_name, 'ADD', create_constraint(@_)); } sub create_constraint { my ($c, $options) = @_; my $generator = _generator($options); my $leave_name = $options->{leave_name} || undef; my $reference_table_name = $generator->quote($c->reference_table); my @fields = $c->fields; if ($c->type eq PRIMARY_KEY) { return unless @fields; return 'PRIMARY KEY (' . join(", ", map { $generator->quote($_) } @fields) . ')'; } elsif ($c->type eq UNIQUE) { return unless @fields; return sprintf 'UNIQUE %s(%s)', ( (defined $c->name && $c->name) ? $generator->quote(truncate_id_uniquely($c->name, $options->{max_id_length} || $DEFAULT_MAX_ID_LENGTH),) . ' ' : '' ), (join ', ', map { $generator->quote($_) } @fields), ; } elsif ($c->type eq FOREIGN_KEY) { return unless @fields; # # Make sure FK field is indexed or MySQL complains. # my $table = $c->table; my $c_name = truncate_id_uniquely($c->name, $options->{max_id_length} || $DEFAULT_MAX_ID_LENGTH); my $def = join(' ', 'CONSTRAINT', ($c_name ? $generator->quote($c_name) : ()), 'FOREIGN KEY'); $def .= ' (' . join(', ', map { $generator->quote($_) } @fields) . ')'; $def .= ' REFERENCES ' . $reference_table_name; my @rfields = map { $_ || () } $c->reference_fields; unless (@rfields) { my $rtable_name = $c->reference_table; if (my $ref_table = $table->schema->get_table($rtable_name)) { push @rfields, $ref_table->primary_key; } else { warn "Can't find reference table '$rtable_name' " . "in schema\n" if $options->{show_warnings}; } } if (@rfields) { $def .= ' (' . join(', ', map { $generator->quote($_) } @rfields) . ')'; } else { warn "FK constraint on " . $table->name . '.' . join('', @fields) . " has no reference fields\n" if $options->{show_warnings}; } if ($c->match_type) { $def .= ' MATCH ' . ($c->match_type =~ /full/i) ? 'FULL' : 'PARTIAL'; } if ($c->on_delete) { $def .= ' ON DELETE ' . $c->on_delete; } if ($c->on_update) { $def .= ' ON UPDATE ' . $c->on_update; } return $def; } elsif ($c->type eq CHECK_C) { my $table = $c->table; my $c_name = truncate_id_uniquely($c->name, $options->{max_id_length} || $DEFAULT_MAX_ID_LENGTH); my $def = join(' ', 'CONSTRAINT', ($c_name ? $generator->quote($c_name) : ()), 'CHECK'); $def .= ' (' . $c->expression . ')'; return $def; } return undef; } sub alter_table { my ($to_table, $options) = @_; my $table_options = generate_table_options($to_table, $options) || ''; my $table_name = _generator($options)->quote($to_table->name); my $out = sprintf('ALTER TABLE %s%s', $table_name, $table_options); return $out; } sub rename_field { alter_field(@_) } sub alter_field { my ($from_field, $to_field, $options) = @_; my $generator = _generator($options); my $table_name = $generator->quote($to_field->table->name); my $out = sprintf( 'ALTER TABLE %s CHANGE COLUMN %s %s', $table_name, $generator->quote($from_field->name), create_field($to_field, $options) ); return $out; } sub add_field { my ($new_field, $options) = @_; my $table_name = _generator($options)->quote($new_field->table->name); my $out = sprintf('ALTER TABLE %s ADD COLUMN %s', $table_name, create_field($new_field, $options)); return $out; } sub drop_field { my ($old_field, $options) = @_; my $generator = _generator($options); my $table_name = $generator->quote($old_field->table->name); my $out = sprintf('ALTER TABLE %s DROP COLUMN %s', $table_name, $generator->quote($old_field->name)); return $out; } sub batch_alter_table { my ($table, $diff_hash, $options) = @_; # InnoDB has an issue with dropping and re-adding a FK constraint under the # name in a single alter statement, see: http://bugs.mysql.com/bug.php?id=13741 # # We have to work round this. my %fks_to_alter; my %fks_to_drop = map { $_->type eq FOREIGN_KEY ? ($_->name => $_) : () } @{ $diff_hash->{alter_drop_constraint} }; my %fks_to_create = map { if ($_->type eq FOREIGN_KEY) { $fks_to_alter{ $_->name } = $fks_to_drop{ $_->name } if $fks_to_drop{ $_->name }; ($_->name => $_); } else { () } } @{ $diff_hash->{alter_create_constraint} }; my @drop_stmt; if (scalar keys %fks_to_alter) { $diff_hash->{alter_drop_constraint} = [ grep { !$fks_to_alter{ $_->name } } @{ $diff_hash->{alter_drop_constraint} } ]; @drop_stmt = batch_alter_table($table, { alter_drop_constraint => [ values %fks_to_alter ] }, $options); } my @stmts = batch_alter_table_statements($diff_hash, $options); #quote my $generator = _generator($options); # rename_table makes things a bit more complex my $renamed_from = ""; $renamed_from = $generator->quote($diff_hash->{rename_table}[0][0]->name) if $diff_hash->{rename_table} && @{ $diff_hash->{rename_table} }; return unless @stmts; # Just zero or one stmts. return now return (@drop_stmt, @stmts) unless @stmts > 1; # Now strip off the 'ALTER TABLE xyz' of all but the first one my $table_name = $generator->quote($table->name); my $re = $renamed_from ? qr/^ALTER TABLE (?:\Q$table_name\E|\Q$renamed_from\E) / : qr/^ALTER TABLE \Q$table_name\E /; my $first = shift @stmts; my ($alter_table) = $first =~ /($re)/; my $padd = " " x length($alter_table); return @drop_stmt, join(",\n", $first, map { s/$re//; $padd . $_ } @stmts); } sub drop_table { my ($table, $options) = @_; return ( # Drop (foreign key) constraints so table drops cleanly batch_alter_table( $table, { alter_drop_constraint => [ grep { $_->type eq 'FOREIGN KEY' } $table->get_constraints ] }, $options ), 'DROP TABLE ' . _generator($options)->quote($table), ); } sub rename_table { my ($old_table, $new_table, $options) = @_; my $generator = _generator($options); my $old_table_name = $generator->quote($old_table); my $new_table_name = $generator->quote($new_table); return "ALTER TABLE $old_table_name RENAME TO $new_table_name"; } sub next_unused_name { my $name = shift || ''; if (!defined($used_names{$name})) { $used_names{$name} = $name; return $name; } my $i = 1; while (defined($used_names{ $name . '_' . $i })) { ++$i; } $name .= '_' . $i; $used_names{$name} = $name; return $name; } 1; =pod =head1 SEE ALSO SQL::Translator, http://www.mysql.com/. =head1 AUTHORS darren chamberlain Edarren@cpan.orgE, Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-1.66/lib/SQL/Translator/Producer/GraphViz.pm0000644000000000000000000004164414716630117023462 0ustar00rootroot00000000000000package SQL::Translator::Producer::GraphViz; =pod =head1 NAME SQL::Translator::Producer::GraphViz - GraphViz producer for SQL::Translator =head1 SYNOPSIS use SQL::Translator; my $trans = SQL::Translator->new( from => 'MySQL', # or your db of choice to => 'GraphViz', producer_args => { out_file => 'schema.png', bgcolor => 'lightgoldenrodyellow', show_constraints => 1, show_datatypes => 1, show_sizes => 1 } ) or die SQL::Translator->error; $trans->translate or die $trans->error; =head1 DESCRIPTION Creates a graph of a schema using the amazing graphviz (see http://www.graphviz.org/) application (via the L module). It's nifty--you should try it! =head1 PRODUCER ARGS All L constructor attributes are accepted and passed through to L. The following defaults are assumed for some attributes: layout => 'dot', overlap => 'false', node => { shape => 'record', style => 'filled', fillcolor => 'white', }, # in inches width => 8.5, height => 11, See the documentation of L for more info on these and other attributes. In addition this producer accepts the following arguments: =over 4 =item * skip_tables An arrayref or a comma-separated list of table names that should be skipped. Note that a skipped table node may still appear if another table has foreign key constraints pointing to the skipped table. If this happens no table field/index information will be included. =item * skip_tables_like An arrayref or a comma-separated list of regular expressions matching table names that should be skipped. =item * cluster Clustering of tables allows you to group and box tables according to function or domain or whatever criteria you choose. The syntax for clustering tables is: cluster => 'cluster1=table1,table2;cluster2=table3,table4' Or pass it as an arrayref like so: cluster => [ 'cluster1=table1,table2', 'cluster2=table3,table4' ] Or like so: cluster => [ { name => 'cluster1', tables => [ 'table1', 'table2' ] }, { name => 'cluster2', tables => [ 'table3', 'table4' ] }, ] =item * out_file The name of the file where the resulting GraphViz output will be written. Alternatively an open filehandle can be supplied. If undefined (the default) - the result is returned as a string. =item * output_type (DEFAULT: 'png') This determines which L will be invoked to generate the graph: C translates to C, C to C and so on. =item * fontname This sets the global font name (or full path to font file) for node, edge, and graph labels =item * fontsize This sets the global font size for node and edge labels (note that arbitrarily large sizes may be ignored due to page size or graph size constraints) =item * show_fields (DEFAULT: true) If set to a true value, the names of the columns in a table will be displayed in each table's node =item * show_fk_only If set to a true value, only columns which are foreign keys will be displayed in each table's node =item * show_datatypes If set to a true value, the datatype of each column will be displayed next to each column's name; this option will have no effect if the value of C is set to false =item * friendly_ints If set to a true value, each integer type field will be displayed as a tinyint, smallint, integer or bigint depending on the field's associated size parameter. This only applies for the C type (and not the C type, which is always assumed to be a 32-bit integer); this option will have no effect if the value of C is set to false =item * friendly_ints_extended If set to a true value, the friendly ints displayed will take into account the non-standard types, 'tinyint' and 'mediumint' (which, as far as I am aware, is only implemented in MySQL) =item * show_sizes If set to a true value, the size (in bytes) of each CHAR and VARCHAR column will be displayed in parentheses next to the column's name; this option will have no effect if the value of C is set to false =item * show_constraints If set to a true value, a field's constraints (i.e., its primary-key-ness, its foreign-key-ness and/or its uniqueness) will appear as a comma-separated list in brackets next to the field's name; this option will have no effect if the value of C is set to false =item * show_indexes If set to a true value, each record will also show the indexes set on each table. It describes the index types along with which columns are included in the index. =item * show_index_names (DEFAULT: true) If C is set to a true value, then the value of this parameter determines whether or not to print names of indexes. if C is false, then a list of indexed columns will appear below the field list. Otherwise, it will be a list prefixed with the name of each index. =item * natural_join If set to a true value, L will be called before generating the graph. =item * join_pk_only The value of this option will be passed as the value of the like-named argument to L; implies C<< natural_join => 1 >> =item * skip_fields The value of this option will be passed as the value of the like-named argument to L; implies C<< natural_join => 1 >> =back =head2 DEPRECATED ARGS =over 4 =item * node_shape Deprecated, use node => { shape => ... } instead =item * add_color Deprecated, use bgcolor => 'lightgoldenrodyellow' instead If set to a true value, the graphic will have a background color of 'lightgoldenrodyellow'; otherwise the default white background will be used =item * nodeattrs Deprecated, use node => { ... } instead =item * edgeattrs Deprecated, use edge => { ... } instead =item * graphattrs Deprecated, use graph => { ... } instead =back =cut use warnings; use strict; use GraphViz; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(debug); use Scalar::Util qw/openhandle/; our $DEBUG; our $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; sub produce { my $t = shift; my $schema = $t->schema; my $args = $t->producer_args; local $DEBUG = $t->debug; # translate legacy {node|edge|graph}attrs to just {node|edge|graph} for my $argtype (qw/node edge graph/) { my $old_arg = $argtype . 'attrs'; my %arglist = (map { %{ $_ || {} } } (delete $args->{$old_arg}, delete $args->{$argtype})); $args->{$argtype} = \%arglist if keys %arglist; } # explode font settings for (qw/fontsize fontname/) { if (defined $args->{$_}) { $args->{node}{$_} ||= $args->{$_}; $args->{edge}{$_} ||= $args->{$_}; $args->{graph}{$_} ||= $args->{$_}; } } # legacy add_color setting, trumped by bgcolor if set $args->{bgcolor} ||= 'lightgoldenrodyellow' if $args->{add_color}; # legacy node_shape setting, defaults to 'record', trumped by {node}{shape} $args->{node}{shape} ||= ($args->{node_shape} || 'record'); # maintain defaults $args->{layout} ||= 'dot'; $args->{output_type} ||= 'png'; $args->{overlap} ||= 'false'; $args->{node}{style} ||= 'filled'; $args->{node}{fillcolor} ||= 'white'; $args->{show_fields} = 1 if not exists $args->{show_fields}; $args->{show_index_names} = 1 if not exists $args->{show_index_names}; $args->{width} = 8.5 if not defined $args->{width}; $args->{height} = 11 if not defined $args->{height}; for ($args->{height}, $args->{width}) { $_ = 0 unless $_ =~ /^\d+(?:.\d+)?$/; $_ = 0 if $_ < 0; } # so split won't warn $args->{$_} ||= '' for qw/skip_fields skip_tables skip_tables_like cluster/; my %skip_fields = map { s/^\s+|\s+$//g; length $_ ? ($_, 1) : () } split(/,/, $args->{skip_fields}); my %skip_tables = map { $_, 1 } ( ref $args->{skip_tables} eq 'ARRAY' ? @{ $args->{skip_tables} } : split(/\s*,\s*/, $args->{skip_tables}) ); my @skip_tables_like = map {qr/$_/} ( ref $args->{skip_tables_like} eq 'ARRAY' ? @{ $args->{skip_tables_like} } : split(/\s*,\s*/, $args->{skip_tables_like}) ); # join_pk_only/skip_fields implies natural_join $args->{natural_join} = 1 if ($args->{join_pk_only} or scalar keys %skip_fields); # usually we do not want direction when using natural join $args->{directed} = ($args->{natural_join} ? 0 : 1) if not exists $args->{directed}; $schema->make_natural_joins( join_pk_only => $args->{join_pk_only}, skip_fields => $args->{skip_fields}, ) if $args->{natural_join}; my %cluster; if (defined $args->{'cluster'}) { my @clusters; if (ref $args->{'cluster'} eq 'ARRAY') { @clusters = @{ $args->{'cluster'} }; } else { @clusters = split /\s*;\s*/, $args->{'cluster'}; } for my $c (@clusters) { my ($cluster_name, @cluster_tables); if (ref $c eq 'HASH') { $cluster_name = $c->{'name'} || $c->{'cluster_name'}; @cluster_tables = @{ $c->{'tables'} || [] }; } else { my ($name, $tables) = split /\s*=\s*/, $c; $cluster_name = $name; @cluster_tables = split /\s*,\s*/, $tables; } for my $table (@cluster_tables) { $cluster{$table} = $cluster_name; } } } # # Create a blank GraphViz object and see if we can produce the output type. # my $gv = GraphViz->new(%$args) or die sprintf("Can't create GraphViz object: %s\n", $@ || 'reason unknown'); my $output_method = "as_$args->{output_type}"; # the generators are AUTOLOADed so can't use ->can ($output_method) eval { $gv->$output_method }; die "Invalid output type: '$args->{output_type}'" if $@; # # Process tables definitions, create nodes # my %nj_registry; # for locations of fields for natural joins my @fk_registry; # for locations of fields for foreign keys TABLE: for my $table ($schema->get_tables) { my $table_name = $table->name; if (@skip_tables_like or keys %skip_tables) { next TABLE if $skip_tables{$table_name}; for my $regex (@skip_tables_like) { next TABLE if $table_name =~ $regex; } } my @fields = $table->get_fields; if ($args->{show_fk_only}) { @fields = grep { $_->is_foreign_key } @fields; } my $field_str = ''; if ($args->{show_fields}) { my @fmt_fields; for my $field (@fields) { my $field_info; if ($args->{show_datatypes}) { my $field_type = $field->data_type; my $size = $field->size; if ( $args->{friendly_ints} && $size && (lc($field_type) eq 'integer')) { # Automatically translate to int2, int4, int8 # Type (Bits) Max. Signed/Unsigned Length # tinyint* (8) 128 3 # 255 3 # smallint (16) 32767 5 # 65535 5 # mediumint* (24) 8388607 7 # 16777215 8 # int (32) 2147483647 10 # 4294967295 11 # bigint (64) 9223372036854775807 19 # 18446744073709551615 20 # # * tinyint and mediumint are nonstandard extensions which are # only available under MySQL (to my knowledge) if ($size <= 3 and $args->{friendly_ints_extended}) { $field_type = 'tinyint'; } elsif ($size <= 5) { $field_type = 'smallint'; } elsif ($size <= 8 and $args->{friendly_ints_extended}) { $field_type = 'mediumint'; } elsif ($size <= 11) { $field_type = 'integer'; } else { $field_type = 'bigint'; } } $field_info = $field_type; if ( $args->{show_sizes} && $size && ($field_type =~ /^ (?: NUMERIC | DECIMAL | (VAR)?CHAR2? ) $/ix)) { $field_info .= '(' . $size . ')'; } } my $constraints; if ($args->{show_constraints}) { my @constraints; push(@constraints, $field->is_auto_increment ? 'PA' : 'PK') if $field->is_primary_key; push(@constraints, 'FK') if $field->is_foreign_key; push(@constraints, 'U') if $field->is_unique; push(@constraints, 'N') if $field->is_nullable; $constraints = join(',', @constraints); } # construct the field line from all info gathered so far push @fmt_fields, join(' ', '-', $field->name, $field_info || (), $constraints ? "[$constraints]" : (),); } # join field lines with graphviz formatting $field_str = join('\l', @fmt_fields) . '\l'; } my $index_str = ''; if ($args->{show_indexes}) { my @fmt_indexes; for my $index ($table->get_indices) { next unless $index->is_valid; push @fmt_indexes, join(' ', '*', $args->{show_index_names} ? $index->name . ':' : (), join(', ', $index->fields), ($index->type eq 'UNIQUE') ? '[U]' : (), ); } # join index lines with graphviz formatting (if any indexes at all) $index_str = join('\l', @fmt_indexes) . '\l' if @fmt_indexes; } my $name_str = $table_name . '\n'; # escape spaces for ($name_str, $field_str, $index_str) { $_ =~ s/ /\\ /g; } my $node_args; # only the 'record' type supports nice formatting if ($args->{node}{shape} eq 'record') { # the necessity to supply shape => 'record' is a graphviz bug $node_args = { shape => 'record', label => sprintf('{%s}', join('|', $name_str, $field_str || (), $index_str || (),),), }; } else { my $sep = sprintf('%s\n', '-' x ((length $table_name) + 2)); $node_args = { label => join($sep, $name_str, $field_str || (), $index_str || (),), }; } if (my $cluster_name = $cluster{$table_name}) { $node_args->{cluster} = $cluster_name; } $gv->add_node(qq["$table_name"], %$node_args); debug("Processing table '$table_name'"); debug("Fields = ", join(', ', map { $_->name } @fields)) if $DEBUG; for my $f (@fields) { my $name = $f->name or next; my $is_pk = $f->is_primary_key; my $is_unique = $f->is_unique; # # Decide if we should skip this field. # if ($args->{natural_join}) { next unless $is_pk || $f->is_foreign_key; } my $constraints = $f->{'constraints'}; if ($args->{natural_join} && !$skip_fields{$name}) { push @{ $nj_registry{$name} }, $table_name; } } unless ($args->{natural_join}) { for my $c ($table->get_constraints) { next unless $c->type eq FOREIGN_KEY; my $fk_table = $c->reference_table or next; for my $field_name ($c->fields) { for my $fk_field ($c->reference_fields) { next unless defined $schema->get_table($fk_table); # a condition is optional if at least one fk is nullable push @fk_registry, [ $table_name, $fk_table, scalar(grep { $_->is_nullable } ($c->fields)) ]; } } } } } # # Process relationships, create edges # my (@table_bunches, %optional_constraints); if ($args->{natural_join}) { for my $field_name (keys %nj_registry) { my @table_names = @{ $nj_registry{$field_name} || [] } or next; next if scalar @table_names == 1; push @table_bunches, [@table_names]; } } else { for my $i (0 .. $#fk_registry) { my $fk = $fk_registry[$i]; push @table_bunches, [ $fk->[0], $fk->[1] ]; $optional_constraints{$i} = $fk->[2]; } } my %done; for my $bi (0 .. $#table_bunches) { my @tables = @{ $table_bunches[$bi] }; for my $i (0 .. $#tables) { my $table1 = $tables[$i]; for my $j (1 .. $#tables) { next if $i == $j; my $table2 = $tables[$j]; next if $done{$table1}{$table2}; debug("Adding edge '$table2' -> '$table1'"); $gv->add_edge( qq["$table2"], qq["$table1"], arrowhead => $optional_constraints{$bi} ? 'empty' : 'normal', ); $done{$table1}{$table2} = 1; } } } # # Print the image # if (my $out = $args->{out_file}) { if (openhandle($out)) { print $out $gv->$output_method; } else { open my $fh, '>', $out or die "Can't write '$out': $!\n"; binmode $fh; print $fh $gv->$output_method; close $fh; } } else { return $gv->$output_method; } } 1; =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE Jonathan Yu Efrequency@cpan.orgE =head1 SEE ALSO SQL::Translator, GraphViz =cut SQL-Translator-1.66/lib/SQL/Translator/Producer/Diagram.pm0000644000000000000000000004066014716630117023271 0ustar00rootroot00000000000000package SQL::Translator::Producer::Diagram; =head1 NAME SQL::Translator::Producer::Diagram - ER diagram producer for SQL::Translator =head1 SYNOPSIS Use via SQL::Translator: use SQL::Translator; my $t = SQL::Translator->new( from => 'MySQL', to => 'Diagram', producer_args => { # All args are optional out_file => 'schema.png',# if not provided will return from translate() output_type => 'png', # is default or 'jpeg' title => 'My Schema', # default is filename font_size => 'medium', # is default or 'small,' 'large' imap_file => '', # filename to write image map coords imap_url => '', # base URL for image map gutter => 30 # is default, px distance b/w cols num_columns => 5, # the number of columns no_lines => 1, # do not draw lines to show FKs add_color => 1, # give it some color show_fk_only => 1, # show only fields used in FKs join_pk_only => 1, # use only primary keys to figure PKs natural_join => 1, # intuit FKs if not defined skip_fields => [...], # list* of field names to exclude skip_tables => [...], # list* of table names to exclude skip_tables_like => [...], # list* of regexen to exclude tables } ) or die SQL::Translator->error; $t->translate; * "list" can be either an array-ref or a comma-separated string =cut use strict; use warnings; use GD; use Data::Dumper; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(debug); our $DEBUG; our $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; use constant VALID_FONT_SIZE => { small => 1, medium => 1, large => 1, huge => 1, }; use constant VALID_IMAGE_TYPE => { png => 1, jpeg => 1, }; sub produce { my $t = shift; my $schema = $t->schema; my $args = $t->producer_args; local $DEBUG = $t->debug; debug("Schema =\n", Dumper($schema)) if $DEBUG; debug("Producer args =\n", Dumper($args)) if $DEBUG; my $out_file = $args->{'out_file'} || ''; my $output_type = $args->{'output_type'} || 'png'; my $title = $args->{'title'} || $t->filename; my $font_size = $args->{'font_size'} || 'medium'; my $imap_file = $args->{'imap_file'} || ''; my $imap_url = $args->{'imap_url'} || ''; my $gutter = $args->{'gutter'} || 30; # distance b/w columns my $num_columns = $args->{'num_columns'} || $args->{'no_columns'} || ''; my $no_lines = $args->{'no_lines'}; my $add_color = $args->{'add_color'}; my $show_fk_only = $args->{'show_fk_only'}; my $join_pk_only = $args->{'join_pk_only'}; my $natural_join = $args->{'natural_join'} || $join_pk_only; my %skip_field = map { $_, 1 } ( ref $args->{'skip_fields'} eq 'ARRAY' ? @{ $args->{'skip_fields'} } : split(/\s*,\s*/, $args->{'skip_fields'} || '') ); my %skip_table = map { $_, 1 } ( ref $args->{'skip_tables'} eq 'ARRAY' ? @{ $args->{'skip_tables'} } : split(/\s*,\s*/, $args->{'skip_tables'} || '') ); my @skip_tables_like = map {qr/$_/} ( ref $args->{'skip_tables_like'} eq 'ARRAY' ? @{ $args->{'skip_tables_like'} } : split(/\s*,\s*/, $args->{'skip_tables_like'} || '') ); my @table_names; if ($natural_join) { $schema->make_natural_joins( join_pk_only => $join_pk_only, skip_fields => $args->{'skip_fields'}, ); my $g = $schema->as_graph_pm; my $d = Graph::Traversal::DFS->new($g, next_alphabetic => 1); $d->preorder; @table_names = $d->dfs; } else { @table_names = map { $_->name } $schema->get_tables; } die "Invalid image type '$output_type'" unless VALID_IMAGE_TYPE->{$output_type}; die "Invalid font size '$font_size'" unless VALID_FONT_SIZE->{$font_size}; # # Layout the image. # my $font = $font_size eq 'small' ? gdTinyFont : $font_size eq 'medium' ? gdSmallFont : $font_size eq 'large' ? gdLargeFont : gdGiantFont; my $num_tables = scalar @table_names; $num_columns = 0 unless $num_columns =~ /^\d+$/; $num_columns ||= sprintf("%.0f", sqrt($num_tables) + .5); $num_columns ||= .5; my $no_per_col = sprintf("%.0f", $num_tables / $num_columns + .5); my @shapes; my ($max_x, $max_y); # the furthest x and y used my $orig_y = 40; # used to reset y for each column my ($x, $y) = (30, $orig_y); # where to start my $cur_col = 1; # the current column my $no_this_col = 0; # number of tables in current column my $this_col_x = $x; # current column's x my %nj_registry; # for locations of fields for natural joins my @fk_registry; # for locations of fields for foreign keys my %table_x; # for max x of each table my $field_no; # counter to give distinct no. to each field my %coords; # holds fields coordinates my @imap_coords; # for making clickable image map my %legend; TABLE: for my $table_name (@table_names) { my $table = $schema->get_table($table_name); if (@skip_tables_like or keys %skip_table) { next TABLE if $skip_table{$table_name}; for my $regex (@skip_tables_like) { next TABLE if $table_name =~ $regex; } } my $top = $y; push @shapes, [ 'string', $font, $this_col_x, $y, $table_name, 'black' ]; $y += $font->height + 2; my $below_table_name = $y; $y += 2; my $this_max_x = $this_col_x + ($font->width * length($table_name)); debug("Processing table '$table_name'"); my @fields = $table->get_fields; debug("Fields = ", join(', ', map { $_->name } @fields)) if $DEBUG; my (@fld_desc, $max_name, $max_desc); for my $f (@fields) { my $name = $f->name or next; my $is_pk = $f->is_primary_key; my @attr; # # Decide if we should skip this field. # if ($show_fk_only) { next unless $is_pk || $f->is_foreign_key; } if ($is_pk) { push @attr, 'PK'; $legend{'Primary key'} = '[PK]'; } if ($f->is_unique) { push @attr, 'U'; $legend{'Unique constraint'} = '[U]'; } if ($f->is_foreign_key) { push @attr, 'FK'; $legend{'Foreign Key'} = '[FK]'; } my $attr = ''; if (@attr) { $attr .= '[' . join(', ', @attr) . ']'; } my $desc = $f->data_type; $desc .= '(' . $f->size . ')' if $f->size && $f->data_type =~ /^(VAR)?CHAR2?$/i; my $nlen = length $name; my $dlen = length $desc; $max_name = $nlen if $nlen > ($max_name || 0); $max_desc = $dlen if $dlen > ($max_desc || 0); push @fld_desc, [ $name, $desc, $f->{'name'}, $is_pk, $attr ]; } $max_name += 2; $max_desc += 2; for my $fld_desc (@fld_desc) { my ($name, $desc, $orig_name, $is_pk, $attr) = @$fld_desc; my $diff1 = $max_name - length $name; my $diff2 = $max_desc - length $desc; $name .= ' ' x $diff1; $desc .= ' ' x $diff2; $desc = $name . $desc . $attr; push @shapes, [ 'string', $font, $this_col_x, $y, $desc, 'black' ]; $y += $font->height + 2; my $length = $this_col_x + ($font->width * length($desc)); $this_max_x = $length if $length > $this_max_x; my $constraints = $table->{'fields'}{$orig_name}{'constraints'}; if ($natural_join && !$skip_field{$orig_name}) { push @{ $nj_registry{$orig_name} }, $table_name; } my $y_link = $y - $font->height / 2; $coords{$table_name}{$orig_name}{'coords'} = { left => [ $this_col_x - 6, $y_link ], right => [ $length + 2, $y_link ], table => $table_name, field_no => ++$field_no, is_pk => $is_pk, fld_name => $orig_name, }; push @imap_coords, [ $imap_url . "#$table_name-$orig_name", $this_col_x, $y - $font->height, $length, $y_link, ]; } unless ($natural_join) { for my $c ($table->get_constraints) { next unless $c->type eq FOREIGN_KEY; my $fk_table = $c->reference_table or next; for my $field_name ($c->fields) { for my $fk_field ($c->reference_fields) { next unless defined $schema->get_table($fk_table); push @fk_registry, [ [ $fk_table, $fk_field ], [ $table_name, $field_name ], ]; } } } } $this_max_x += 5; $table_x{$table_name} = $this_max_x + 5; push @shapes, [ 'line', $this_col_x - 5, $below_table_name, $this_max_x, $below_table_name, 'black' ]; my @bounds = ($this_col_x - 5, $top - 5, $this_max_x, $y + 5); if ($add_color) { unshift @shapes, [ 'filledRectangle', $bounds[0], $bounds[1], $this_max_x, $below_table_name, 'khaki' ]; unshift @shapes, [ 'filledRectangle', @bounds, 'white' ]; } push @imap_coords, [ $imap_url . "#$table_name", $bounds[0], $bounds[1], $this_max_x, $below_table_name, ]; push @shapes, [ 'rectangle', @bounds, 'black' ]; $max_x = $this_max_x if $this_max_x > ($max_x || 0); $y += 25; if (++$no_this_col == $no_per_col) { # if we've filled up this column $cur_col++; # up the column number $no_this_col = 0; # reset the number of tables $max_x += $gutter; # push the x over for next column $this_col_x = $max_x; # remember the max x for this col $max_y = $y if $y > ($max_y || 0); # note the max y $y = $orig_y; # reset the y for next column } } # # Connect the lines. # my %horz_taken; my %done; unless ($no_lines) { my @position_bunches; if ($natural_join) { for my $field_name (keys %nj_registry) { my @positions; my @table_names = @{ $nj_registry{$field_name} || [] } or next; next if scalar @table_names == 1; for my $table_name (@table_names) { push @positions, $coords{$table_name}{$field_name}{'coords'}; } push @position_bunches, [@positions]; } } else { for my $pair (@fk_registry) { push @position_bunches, [ $coords{ $pair->[0][0] }{ $pair->[0][1] }{'coords'}, $coords{ $pair->[1][0] }{ $pair->[1][1] }{'coords'}, ]; } } my $is_directed = $natural_join ? 0 : 1; for my $bunch (@position_bunches) { my @positions = @$bunch; for my $i (0 .. $#positions) { my $pos1 = $positions[$i]; my ($ax, $ay) = @{ $pos1->{'left'} || [] } or next; my ($bx, $by) = @{ $pos1->{'right'} || [] } or next; my $table1 = $pos1->{'table'}; my $fno1 = $pos1->{'field_no'}; my $is_pk = $pos1->{'is_pk'}; next if $join_pk_only and !$is_pk; for my $j (0 .. $#positions) { my $pos2 = $positions[$j]; my ($cx, $cy) = @{ $pos2->{'left'} || [] } or next; my ($dx, $dy) = @{ $pos2->{'right'} || [] } or next; my $table2 = $pos2->{'table'}; my $fno2 = $pos2->{'field_no'}; next if $table1 eq $table2; next if $done{$fno1}{$fno2}; next if $fno1 == $fno2; my @distances = (); push @distances, [ abs($ax - $cx) + abs($ay - $cy), [ $ax, $ay, $cx, $cy ], [ 'left', 'left' ] ]; push @distances, [ abs($ax - $dx) + abs($ay - $dy), [ $ax, $ay, $dx, $dy ], [ 'left', 'right' ], ]; push @distances, [ abs($bx - $cx) + abs($by - $cy), [ $bx, $by, $cx, $cy ], [ 'right', 'left' ], ]; push @distances, [ abs($bx - $dx) + abs($by - $dy), [ $bx, $by, $dx, $dy ], [ 'right', 'right' ], ]; @distances = sort { $a->[0] <=> $b->[0] } @distances; my $shortest = $distances[0]; my ($x1, $y1, $x2, $y2) = @{ $shortest->[1] }; my ($side1, $side2) = @{ $shortest->[2] }; my ($start, $end); my $offset = 9; my $col1_right = $table_x{$table1}; my $col2_right = $table_x{$table2}; my $diff = 0; if ($x1 == $x2) { while ($horz_taken{ $x1 + $diff }) { $diff = $side1 eq 'left' ? $diff - 2 : $diff + 2; } $horz_taken{ $x1 + $diff } = 1; } if ($side1 eq 'left') { $start = $x1 - $offset + $diff; } else { $start = $col1_right + $diff; } if ($side2 eq 'left') { $end = $x2 - $offset + $diff; } else { $end = $col2_right + $diff; } push @shapes, [ 'line', $x1, $y1, $start, $y1, 'cadetblue' ]; push @shapes, [ 'line', $start, $y1, $end, $y2, 'cadetblue' ]; push @shapes, [ 'line', $end, $y2, $x2, $y2, 'cadetblue' ]; if ($is_directed) { if ( $side1 eq 'right' && $side2 eq 'left' || $side1 eq 'left' && $side2 eq 'left') { push @shapes, [ 'line', $x2 - 3, $y2 - 3, $x2, $y2, 'cadetblue' ]; push @shapes, [ 'line', $x2 - 3, $y2 + 3, $x2, $y2, 'cadetblue' ]; push @shapes, [ 'line', $x2 - 3, $y2 - 3, $x2 - 3, $y2 + 3, 'cadetblue' ]; } else { push @shapes, [ 'line', $x2 + 3, $y2 - 3, $x2, $y2, 'cadetblue' ]; push @shapes, [ 'line', $x2 + 3, $y2 + 3, $x2, $y2, 'cadetblue' ]; push @shapes, [ 'line', $x2 + 3, $y2 - 3, $x2 + 3, $y2 + 3, 'cadetblue' ]; } } $done{$fno1}{$fno2} = 1; $done{$fno2}{$fno1} = 1; } } } } # # Add the title, legend and signature. # my $large_font = gdLargeFont; my $title_len = $large_font->width * length $title; push @shapes, [ 'string', $large_font, $max_x / 2 - $title_len / 2, 10, $title, 'black' ]; if (%legend) { $max_y += 5; push @shapes, [ 'string', $font, $x, $max_y - $font->height - 4, 'Legend', 'black' ]; $max_y += $font->height + 4; my $longest; for my $len (map { length $_ } values %legend) { $longest = $len if $len > ($longest || 0); } $longest += 2; while (my ($key, $shape) = each %legend) { my $space = $longest - length $shape; push @shapes, [ 'string', $font, $x, $max_y - $font->height - 4, join('', $shape, ' ' x $space, $key), 'black' ]; $max_y += $font->height + 4; } } my $sig = 'Created by SQL::Translator ' . $t->version; my $sig_len = $font->width * length $sig; push @shapes, [ 'string', $font, $max_x - $sig_len, $max_y - $font->height - 4, $sig, 'black' ]; # # Render the image. # my $gd = GD::Image->new($max_x + 30, $max_y); unless ($gd->can($output_type)) { die "GD can't create images of type '$output_type'\n"; } my %colors = map { $_->[0], $gd->colorAllocate(@{ $_->[1] }) } ( [ white => [ 255, 255, 255 ] ], [ beige => [ 245, 245, 220 ] ], [ black => [ 0, 0, 0 ] ], [ lightblue => [ 173, 216, 230 ] ], [ cadetblue => [ 95, 158, 160 ] ], [ lightgoldenrodyellow => [ 250, 250, 210 ] ], [ khaki => [ 240, 230, 140 ] ], [ red => [ 255, 0, 0 ] ], ); $gd->interlaced('true'); my $background_color = $add_color ? 'lightgoldenrodyellow' : 'white'; $gd->fill(0, 0, $colors{$background_color}); for my $shape (@shapes) { my $method = shift @$shape; my $color = pop @$shape; $gd->$method(@$shape, $colors{$color}); } # # Make image map. # debug("imap file = '$imap_file'"); if ($imap_file && @imap_coords) { open my $fh, '>', $imap_file or die "Can't write '$imap_file': $!\n"; print $fh qq[\n] . qq[\n]; for my $rec (@imap_coords) { my $href = shift @$rec; print $fh q[\n]; } print $fh qq[]; close $fh; } # # Print the image. # if ($out_file) { open my $fh, '>', $out_file or die "Can't write '$out_file': $!\n"; binmode $fh; print $fh $gd->$output_type; close $fh; } else { return $gd->$output_type; } } 1; =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-1.66/lib/SQL/Translator/Producer/PostgreSQL.pm0000644000000000000000000010604114716630117023724 0ustar00rootroot00000000000000package SQL::Translator::Producer::PostgreSQL; =head1 NAME SQL::Translator::Producer::PostgreSQL - PostgreSQL producer for SQL::Translator =head1 SYNOPSIS my $t = SQL::Translator->new( parser => '...', producer => 'PostgreSQL' ); $t->translate; =head1 DESCRIPTION Creates a DDL suitable for PostgreSQL. Very heavily based on the Oracle producer. Now handles PostGIS Geometry and Geography data types on table definitions. Does not yet support PostGIS Views. =head2 Producer Args You can change the global behavior of the producer by passing the following options to the C attribute of C. =over 4 =item postgres_version The version of postgres to generate DDL for. Turns on features only available in later versions. The following features are supported =over 4 =item IF EXISTS If your postgres_version is higher than 8.003 (I should hope it is by now), then the DDL generated for dropping objects in the database will contain IF EXISTS. =back =item attach_comments Generates table and column comments via the COMMENT command rather than as a comment in the DDL. You could then look it up with \dt+ or \d+ (for tables and columns respectively) in psql. The comment is dollar quoted with $comment$ so you can include ' in it. Just to clarify: you get this CREATE TABLE foo ...; COMMENT on TABLE foo IS $comment$hi there$comment$; instead of this -- comment CREAT TABLE foo ...; =back =head2 Extra args Various schema types support various options via the C attribute. =over 2 =item Tables =over 2 =item temporary Produces a temporary table. =back =item Views =over 2 =item temporary Produces a temporary view. =item materialized Produces a materialized view. =back =item Fields =over 2 =item list, custom_type_name For enum types, list is the list of valid values, and custom_type_name is the name that the type should have. Defaults to $table_$field_type. =item geometry_type, srid, dimensions, geography_type Fields for use with PostGIS types. =back =back =cut use strict; use warnings; our ($DEBUG, $WARN); our $VERSION = '1.66'; $DEBUG = 0 unless defined $DEBUG; use base qw(SQL::Translator::Producer); use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(debug header_comment parse_dbms_version batch_alter_table_statements normalize_quote_options); use SQL::Translator::Generator::DDL::PostgreSQL; use Data::Dumper; use constant MAX_ID_LENGTH => 62; { my ($quoting_generator, $nonquoting_generator); sub _generator { my $options = shift; return $options->{generator} if exists $options->{generator}; return normalize_quote_options($options) ? $quoting_generator ||= SQL::Translator::Generator::DDL::PostgreSQL->new : $nonquoting_generator ||= SQL::Translator::Generator::DDL::PostgreSQL->new(quote_chars => [],); } } my (%translate); BEGIN { %translate = ( # # MySQL types # double => 'double precision', decimal => 'numeric', int => 'integer', mediumint => 'integer', tinyint => 'smallint', char => 'character', varchar => 'character varying', longtext => 'text', mediumtext => 'text', tinytext => 'text', tinyblob => 'bytea', blob => 'bytea', mediumblob => 'bytea', longblob => 'bytea', enum => 'character varying', set => 'character varying', datetime => 'timestamp', year => 'date', # # Oracle types # number => 'integer', varchar2 => 'character varying', long => 'text', clob => 'text', # # Sybase types # comment => 'text', # # MS Access types # memo => 'text', ); } my %truncated; =pod =head1 PostgreSQL Create Table Syntax CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name ( { column_name data_type [ DEFAULT default_expr ] [ column_constraint [, ... ] ] | table_constraint } [, ... ] ) [ INHERITS ( parent_table [, ... ] ) ] [ WITH OIDS | WITHOUT OIDS ] where column_constraint is: [ CONSTRAINT constraint_name ] { NOT NULL | NULL | UNIQUE | PRIMARY KEY | CHECK (expression) | REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] } [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] and table_constraint is: [ CONSTRAINT constraint_name ] { UNIQUE ( column_name [, ... ] ) | PRIMARY KEY ( column_name [, ... ] ) | CHECK ( expression ) | EXCLUDE [USING acc_method] (expression) [INCLUDE (column [, ...])] [WHERE (predicate)] FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] } [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] =head1 Create Index Syntax CREATE [ UNIQUE ] INDEX index_name ON table [ USING acc_method ] ( column [ ops_name ] [, ...] ) [ INCLUDE ( column [, ...] ) ] [ WHERE predicate ] CREATE [ UNIQUE ] INDEX index_name ON table [ USING acc_method ] ( func_name( column [, ... ]) [ ops_name ] ) [ WHERE predicate ] =cut sub produce { my $translator = shift; local $DEBUG = $translator->debug; local $WARN = $translator->show_warnings; my $no_comments = $translator->no_comments; my $add_drop_table = $translator->add_drop_table; my $schema = $translator->schema; my $pargs = $translator->producer_args; my $postgres_version = parse_dbms_version($pargs->{postgres_version}, 'perl'); my $generator = _generator({ quote_identifiers => $translator->quote_identifiers }); my @output; push @output, header_comment unless ($no_comments); my (@table_defs, @fks); my %type_defs; for my $table ($schema->get_tables) { my ($table_def, $fks) = create_table( $table, { generator => $generator, no_comments => $no_comments, postgres_version => $postgres_version, add_drop_table => $add_drop_table, type_defs => \%type_defs, attach_comments => $pargs->{attach_comments} } ); push @table_defs, $table_def; push @fks, @$fks; } for my $view ($schema->get_views) { push @table_defs, create_view( $view, { postgres_version => $postgres_version, add_drop_view => $add_drop_table, generator => $generator, no_comments => $no_comments, } ); } for my $trigger ($schema->get_triggers) { push @table_defs, create_trigger( $trigger, { add_drop_trigger => $add_drop_table, generator => $generator, no_comments => $no_comments, } ); } push @output, map {"$_;\n\n"} values %type_defs; push @output, map {"$_;\n\n"} @table_defs; if (@fks) { push @output, "--\n-- Foreign Key Definitions\n--\n\n" unless $no_comments; push @output, map {"$_;\n\n"} @fks; } if ($WARN) { if (%truncated) { warn "Truncated " . keys(%truncated) . " names:\n"; warn "\t" . join("\n\t", sort keys %truncated) . "\n"; } } return wantarray ? @output : join('', @output); } { my %global_names; sub mk_name { my $basename = shift || ''; my $type = shift || ''; my $scope = shift || ''; my $critical = shift || ''; my $basename_orig = $basename; my $max_name = $type ? MAX_ID_LENGTH - (length($type) + 1) : MAX_ID_LENGTH; $basename = substr($basename, 0, $max_name) if length($basename) > $max_name; my $name = $type ? "${type}_$basename" : $basename; if ($basename ne $basename_orig and $critical) { my $show_type = $type ? "+'$type'" : ""; warn "Truncating '$basename_orig'$show_type to ", MAX_ID_LENGTH, " character limit to make '$name'\n" if $WARN; $truncated{$basename_orig} = $name; } $scope ||= \%global_names; if (my $prev = $scope->{$name}) { my $name_orig = $name; $name .= sprintf("%02d", ++$prev); substr($name, MAX_ID_LENGTH - 3) = "00" if length($name) > MAX_ID_LENGTH; warn "The name '$name_orig' has been changed to ", "'$name' to make it unique.\n" if $WARN; $scope->{$name_orig}++; } $scope->{$name}++; return $name; } } sub is_geometry { my $field = shift; return 1 if $field->data_type eq 'geometry'; } sub is_geography { my $field = shift; return 1 if $field->data_type eq 'geography'; } sub create_table { my ($table, $options) = @_; my $generator = _generator($options); my $no_comments = $options->{no_comments} || 0; my $add_drop_table = $options->{add_drop_table} || 0; my $postgres_version = $options->{postgres_version} || 0; my $type_defs = $options->{type_defs} || {}; my $attach_comments = $options->{attach_comments}; my $table_name = $table->name or next; my $table_name_qt = $generator->quote($table_name); my (@comments, @field_defs, @index_defs, @constraint_defs, @fks); push @comments, "--\n-- Table: $table_name\n--\n" unless $no_comments; my @comment_statements; if (my $comments = $table->comments) { if ($attach_comments) { # this follows the example in the MySQL producer, where all comments are added as # table comments, even though they could have originally been parsed as DDL comments # quoted via $$ string so there can be 'quotes' inside the comments my $comment_ddl = "COMMENT on TABLE $table_name_qt IS \$comment\$$comments\$comment\$"; push @comment_statements, $comment_ddl; } elsif (!$no_comments) { $comments =~ s/^/-- /mg; push @comments, "-- Comments:\n$comments\n--\n"; } } # # Fields # for my $field ($table->get_fields) { push @field_defs, create_field( $field, { generator => $generator, postgres_version => $postgres_version, type_defs => $type_defs, constraint_defs => \@constraint_defs, attach_comments => $attach_comments } ); if ($attach_comments) { my $field_comments = $field->comments; next unless $field_comments; my $field_name_qt = $generator->quote($field->name); my $comment_ddl = "COMMENT on COLUMN $table_name_qt.$field_name_qt IS \$comment\$$field_comments\$comment\$"; push @comment_statements, $comment_ddl; } } # # Index Declarations # for my $index ($table->get_indices) { my ($idef, $constraints) = create_index( $index, { generator => $generator, postgres_version => $postgres_version, } ); $idef and push @index_defs, $idef; push @constraint_defs, @$constraints; } # # Table constraints # for my $c ($table->get_constraints) { my ($cdefs, $fks) = create_constraint( $c, { generator => $generator, } ); push @constraint_defs, @$cdefs; push @fks, @$fks; } my $create_statement = join("\n", @comments); if ($add_drop_table) { if ($postgres_version >= 8.002) { $create_statement .= "DROP TABLE IF EXISTS $table_name_qt CASCADE;\n"; } else { $create_statement .= "DROP TABLE $table_name_qt CASCADE;\n"; } } my $temporary = $table->extra->{temporary} ? "TEMPORARY " : ""; $create_statement .= "CREATE ${temporary}TABLE $table_name_qt (\n" . join(",\n", map {" $_"} @field_defs, @constraint_defs) . "\n)"; $create_statement .= @index_defs ? ';' : q{}; $create_statement .= ($create_statement =~ /;$/ ? "\n" : q{}) . join(";\n", @index_defs); # # Geometry # if (my @geometry_columns = grep { is_geometry($_) } $table->get_fields) { $create_statement .= join(";\n", '', map { drop_geometry_column($_, $options) } @geometry_columns) if $options->{add_drop_table}; $create_statement .= join(";\n", '', map { add_geometry_column($_, $options) } @geometry_columns); } if (@comment_statements) { $create_statement .= join(";\n", '', @comment_statements); } return $create_statement, \@fks; } sub create_view { my ($view, $options) = @_; my $generator = _generator($options); my $postgres_version = $options->{postgres_version} || 0; my $add_drop_view = $options->{add_drop_view}; my $view_name = $view->name; debug("PKG: Looking at view '${view_name}'\n"); my $create = ''; $create .= "--\n-- View: " . $generator->quote($view_name) . "\n--\n" unless $options->{no_comments}; if ($add_drop_view) { if ($postgres_version >= 8.002) { $create .= "DROP VIEW IF EXISTS " . $generator->quote($view_name) . ";\n"; } else { $create .= "DROP VIEW " . $generator->quote($view_name) . ";\n"; } } $create .= 'CREATE'; my $extra = $view->extra; $create .= " TEMPORARY" if exists($extra->{temporary}) && $extra->{temporary}; $create .= " MATERIALIZED" if exists($extra->{materialized}) && $extra->{materialized}; $create .= " VIEW " . $generator->quote($view_name); if (my @fields = $view->fields) { my $field_list = join ', ', map { $generator->quote($_) } @fields; $create .= " ( ${field_list} )"; } if (my $sql = $view->sql) { $create .= " AS\n ${sql}\n"; } if ($extra->{check_option}) { $create .= ' WITH ' . uc $extra->{check_option} . ' CHECK OPTION'; } return $create; } # Returns a enum custom type name and list of values iff the field looks like an enum. sub _enum_typename_and_values { my $field = shift; if (ref $field->extra->{list} eq 'ARRAY') { # can't do anything unless we know the list if ($field->extra->{custom_type_name}) { return ($field->extra->{custom_type_name}, $field->extra->{list}); } elsif ($field->data_type eq 'enum') { my $name = $field->table->name . '_' . $field->name . '_type'; return ($name, $field->extra->{list}); } } return (); } { my %field_name_scope; sub create_field { my ($field, $options) = @_; my $generator = _generator($options); my $table_name = $field->table->name; my $constraint_defs = $options->{constraint_defs} || []; my $postgres_version = $options->{postgres_version} || 0; my $type_defs = $options->{type_defs} || {}; my $attach_comments = $options->{attach_comments}; $field_name_scope{$table_name} ||= {}; my $field_name = $field->name; my $field_comments = ''; if (!$attach_comments and my $comments = $field->comments) { $comments =~ s/(?quote($field_name); # # Datatype # my $data_type = lc $field->data_type; my %extra = $field->extra; my ($enum_typename, $list) = _enum_typename_and_values($field); if ($postgres_version >= 8.003 && $enum_typename) { my $commalist = join(', ', map { __PACKAGE__->_quote_string($_) } @$list); $field_def .= ' ' . $enum_typename; my $new_type_def = "DROP TYPE IF EXISTS $enum_typename CASCADE;\n" . "CREATE TYPE $enum_typename AS ENUM ($commalist)"; if (!exists $type_defs->{$enum_typename}) { $type_defs->{$enum_typename} = $new_type_def; } elsif ($type_defs->{$enum_typename} ne $new_type_def) { die "Attempted to redefine type name '$enum_typename' as a different type.\n"; } } else { $field_def .= ' ' . convert_datatype($field); } # # Default value # __PACKAGE__->_apply_default_value( $field, \$field_def, [ 'NULL' => \'NULL', 'now()' => 'now()', 'CURRENT_TIMESTAMP' => 'CURRENT_TIMESTAMP', ], ); # # Not null constraint # $field_def .= ' NOT NULL' unless $field->is_nullable; # # Geometry constraints # if (is_geometry($field)) { foreach (create_geometry_constraints($field, $options)) { my ($cdefs, $fks) = create_constraint($_, $options); push @$constraint_defs, @$cdefs; push @$fks, @$fks; } } return $field_def; } } sub create_geometry_constraints { my ($field, $options) = @_; my $fname = _generator($options)->quote($field); my @constraints; push @constraints, SQL::Translator::Schema::Constraint->new( name => "enforce_dims_" . $field->name, expression => "(ST_NDims($fname) = " . $field->extra->{dimensions} . ")", table => $field->table, type => CHECK_C, ); push @constraints, SQL::Translator::Schema::Constraint->new( name => "enforce_srid_" . $field->name, expression => "(ST_SRID($fname) = " . $field->extra->{srid} . ")", table => $field->table, type => CHECK_C, ); push @constraints, SQL::Translator::Schema::Constraint->new( name => "enforce_geotype_" . $field->name, expression => "(GeometryType($fname) = " . __PACKAGE__->_quote_string($field->extra->{geometry_type}) . "::text OR $fname IS NULL)", table => $field->table, type => CHECK_C, ); return @constraints; } sub _extract_extras_from_options { my ($options_haver, $dispatcher) = @_; for my $opt ($options_haver->options) { if (ref $opt eq 'HASH') { for my $key (keys %$opt) { my $val = $opt->{$key}; next unless defined $val; $dispatcher->{ lc $key }->($val); } } } } { my %index_name; sub create_index { my ($index, $options) = @_; my $generator = _generator($options); my $table_name = $index->table->name; my $postgres_version = $options->{postgres_version} || 0; my ($index_def, @constraint_defs); my $name = $index->name || join('_', $table_name, 'idx', ++$index_name{$table_name}); my $type = $index->type || NORMAL; my @fields = $index->fields; return unless @fields; my %index_extras; _extract_extras_from_options( $index, { using => sub { $index_extras{using} = "USING $_[0]" }, where => sub { $index_extras{where} = "WHERE $_[0]" }, include => sub { my ($value) = @_; return unless $postgres_version >= 11; die 'Include list must be an arrayref' unless ref $value eq 'ARRAY'; my $value_list = join ', ', @$value; $index_extras{include} = "INCLUDE ($value_list)"; } } ); my $def_start = 'CONSTRAINT ' . $generator->quote($name) . ' '; my $field_names = '(' . join(", ", (map { $_ =~ /\(.*\)/ ? $_ : ($generator->quote($_)) } @fields)) . ')'; if ($type eq PRIMARY_KEY) { push @constraint_defs, "${def_start}PRIMARY KEY " . $field_names; } elsif ($type eq UNIQUE) { push @constraint_defs, "${def_start}UNIQUE " . $field_names; } elsif ($type eq NORMAL) { $index_def = 'CREATE INDEX ' . $generator->quote($name) . ' on ' . $generator->quote($table_name) . ' ' . join ' ', grep {defined} $index_extras{using}, $field_names, @index_extras{ 'include', 'where' }; } else { warn "Unknown index type ($type) on table $table_name.\n" if $WARN; } return $index_def, \@constraint_defs; } } sub create_constraint { my ($c, $options) = @_; my $generator = _generator($options); my $postgres_version = $options->{postgres_version} || 0; my $table_name = $c->table->name; my (@constraint_defs, @fks); my %constraint_extras; _extract_extras_from_options( $c, { using => sub { $constraint_extras{using} = "USING $_[0]" }, where => sub { $constraint_extras{where} = "WHERE ( $_[0] )" }, include => sub { my ($value) = @_; return unless $postgres_version >= 11; die 'Include list must be an arrayref' unless ref $value eq 'ARRAY'; my $value_list = join ', ', @$value; $constraint_extras{include} = "INCLUDE ( $value_list )"; }, } ); my $name = $c->name || ''; my @fields = grep {defined} $c->fields; my @rfields = grep {defined} $c->reference_fields; return if !@fields && ($c->type ne CHECK_C && $c->type ne EXCLUDE); my $def_start = $name ? 'CONSTRAINT ' . $generator->quote($name) : ''; my $field_names = '(' . join(", ", (map { $_ =~ /\(.*\)/ ? $_ : ($generator->quote($_)) } @fields)) . ')'; my $include = $constraint_extras{include} || ''; if ($c->type eq PRIMARY_KEY) { push @constraint_defs, join ' ', grep $_, $def_start, "PRIMARY KEY", $field_names, $include; } elsif ($c->type eq UNIQUE) { push @constraint_defs, join ' ', grep $_, $def_start, "UNIQUE", $field_names, $include; } elsif ($c->type eq CHECK_C) { my $expression = $c->expression; push @constraint_defs, join ' ', grep $_, $def_start, "CHECK ($expression)"; } elsif ($c->type eq FOREIGN_KEY) { my $def .= join ' ', grep $_, "ALTER TABLE", $generator->quote($table_name), 'ADD', $def_start, "FOREIGN KEY $field_names"; $def .= "\n REFERENCES " . $generator->quote($c->reference_table); if (@rfields) { $def .= ' (' . join(', ', map { $generator->quote($_) } @rfields) . ')'; } if ($c->match_type) { $def .= ' MATCH ' . ($c->match_type =~ /full/i) ? 'FULL' : 'PARTIAL'; } if ($c->on_delete) { $def .= ' ON DELETE ' . $c->on_delete; } if ($c->on_update) { $def .= ' ON UPDATE ' . $c->on_update; } if ($c->deferrable) { $def .= ' DEFERRABLE'; } push @fks, "$def"; } elsif ($c->type eq EXCLUDE) { my $using = $constraint_extras{using} || ''; my $expression = $c->expression; my $where = $constraint_extras{where} || ''; push @constraint_defs, join ' ', grep $_, $def_start, 'EXCLUDE', $using, "( $expression )", $include, $where; } return \@constraint_defs, \@fks; } sub create_trigger { my ($trigger, $options) = @_; my $generator = _generator($options); my @statements; push @statements, sprintf('DROP TRIGGER IF EXISTS %s', $generator->quote($trigger->name)) if $options->{add_drop_trigger}; my $scope = $trigger->scope || ''; $scope = " FOR EACH $scope" if $scope; push @statements, sprintf( 'CREATE TRIGGER %s %s %s ON %s%s %s', $generator->quote($trigger->name), $trigger->perform_action_when, join(' OR ', @{ $trigger->database_events }), $generator->quote($trigger->on_table), $scope, $trigger->action, ); return @statements; } sub convert_datatype { my ($field) = @_; my @size = $field->size; my $data_type = lc $field->data_type; my $array = $data_type =~ s/\[\]$//; if ($data_type eq 'enum') { # my $len = 0; # $len = ($len < length($_)) ? length($_) : $len for (@$list); # my $chk_name = mk_name( $table_name.'_'.$field_name, 'chk' ); # push @$constraint_defs, # 'CONSTRAINT "$chk_name" CHECK (' . $generator->quote(field_name) . # qq[IN ($commalist))]; $data_type = 'character varying'; } elsif ($data_type eq 'set') { $data_type = 'character varying'; } elsif ($field->is_auto_increment) { if ((defined $size[0] && $size[0] > 11) or $data_type eq 'bigint') { $data_type = 'bigserial'; } else { $data_type = 'serial'; } undef @size; } else { $data_type = defined $translate{ lc $data_type } ? $translate{ lc $data_type } : $data_type; } if ($data_type =~ /^time/i || $data_type =~ /^interval/i) { if (defined $size[0] && $size[0] > 6) { $size[0] = 6; } } if ($data_type eq 'integer') { if (defined $size[0] && $size[0] > 0) { if ($size[0] > 10) { $data_type = 'bigint'; } elsif ($size[0] < 5) { $data_type = 'smallint'; } else { $data_type = 'integer'; } } else { $data_type = 'integer'; } } my $type_with_size = join('|', 'bit', 'varbit', 'character', 'bit varying', 'character varying', 'time', 'timestamp', 'interval', 'numeric', 'float'); if ($data_type !~ /$type_with_size/) { @size = (); } if (defined $size[0] && $size[0] > 0 && $data_type =~ /^time/i) { $data_type =~ s/^(time.*?)( with.*)?$/$1($size[0])/; $data_type .= $2 if (defined $2); } elsif (defined $size[0] && $size[0] > 0) { $data_type .= '(' . join(',', @size) . ')'; } if ($array) { $data_type .= '[]'; } # # Geography # if ($data_type eq 'geography') { $data_type .= '(' . $field->extra->{geography_type} . ',' . $field->extra->{srid} . ')'; } return $data_type; } sub alter_field { my ($from_field, $to_field, $options) = @_; die "Can't alter field in another table" if ($from_field->table->name ne $to_field->table->name); my $generator = _generator($options); my @out; # drop geometry column and constraints push @out, drop_geometry_column($from_field, $options), drop_geometry_constraints($from_field, $options), if is_geometry($from_field); # it's necessary to start with rename column cause this would affect # all of the following statements which would be broken if do the # rename later # BUT: drop geometry is done before the rename, cause it work's on the # $from_field directly push @out, sprintf('ALTER TABLE %s RENAME COLUMN %s TO %s', map($generator->quote($_), $to_field->table->name, $from_field->name, $to_field->name,),) if ($from_field->name ne $to_field->name); push @out, sprintf('ALTER TABLE %s ALTER COLUMN %s SET NOT NULL', map($generator->quote($_), $to_field->table->name, $to_field->name),) if (!$to_field->is_nullable and $from_field->is_nullable); push @out, sprintf('ALTER TABLE %s ALTER COLUMN %s DROP NOT NULL', map($generator->quote($_), $to_field->table->name, $to_field->name),) if (!$from_field->is_nullable and $to_field->is_nullable); my $from_dt = convert_datatype($from_field); my $to_dt = convert_datatype($to_field); push @out, sprintf('ALTER TABLE %s ALTER COLUMN %s TYPE %s', map($generator->quote($_), $to_field->table->name, $to_field->name), $to_dt,) if ($to_dt ne $from_dt); my ($from_enum_typename, $from_list) = _enum_typename_and_values($from_field); my ($to_enum_typename, $to_list) = _enum_typename_and_values($to_field); if ( $from_enum_typename && $to_enum_typename && $from_enum_typename eq $to_enum_typename) { # See if new enum values were added, and update the enum my %existing_vals = map +($_ => 1), @$from_list; my %desired_vals = map +($_ => 1), @$to_list; my @add_vals = grep !$existing_vals{$_}, keys %desired_vals; my @del_vals = grep !$desired_vals{$_}, keys %existing_vals; my $pg_ver_ok = ($options->{postgres_version} || 0) >= 9.001; push @out, '-- Set $sqlt->producer_args->{postgres_version} >= 9.001 to alter enums' if !$pg_ver_ok && @add_vals; for (@add_vals) { push @out, sprintf '%sALTER TYPE %s ADD VALUE IF NOT EXISTS %s', ($pg_ver_ok ? '' : '-- '), $to_enum_typename, $generator->quote_string($_); } push @out, "-- Unimplemented: delete values from enum type '$to_enum_typename': " . join(", ", @del_vals) if @del_vals; } my $old_default = $from_field->default_value; my $new_default = $to_field->default_value; my $default_value = $to_field->default_value; # fixes bug where output like this was created: # ALTER TABLE users ALTER COLUMN column SET DEFAULT ThisIsUnescaped; if (ref $default_value eq "SCALAR") { $default_value = $$default_value; } elsif (defined $default_value && $to_dt =~ /^(character|text|timestamp|date)/xsmi) { $default_value = __PACKAGE__->_quote_string($default_value); } push @out, sprintf( 'ALTER TABLE %s ALTER COLUMN %s SET DEFAULT %s', map($generator->quote($_), $to_field->table->name, $to_field->name,), $default_value, ) if (defined $new_default && (!defined $old_default || $old_default ne $new_default)); # fixes bug where removing the DEFAULT statement of a column # would result in no change push @out, sprintf('ALTER TABLE %s ALTER COLUMN %s DROP DEFAULT', map($generator->quote($_), $to_field->table->name, $to_field->name,),) if (!defined $new_default && defined $old_default); # add geometry column and constraints push @out, add_geometry_column($to_field, $options), add_geometry_constraints($to_field, $options), if is_geometry($to_field); return wantarray ? @out : join(";\n", @out); } sub rename_field { alter_field(@_) } sub add_field { my ($new_field, $options) = @_; my $out = sprintf( 'ALTER TABLE %s ADD COLUMN %s', _generator($options)->quote($new_field->table->name), create_field($new_field, $options) ); $out .= ";\n" . add_geometry_column($new_field, $options) . ";\n" . add_geometry_constraints($new_field, $options) if is_geometry($new_field); return $out; } sub drop_field { my ($old_field, $options) = @_; my $generator = _generator($options); my $out = sprintf( 'ALTER TABLE %s DROP COLUMN %s', $generator->quote($old_field->table->name), $generator->quote($old_field->name) ); $out .= ";\n" . drop_geometry_column($old_field, $options) if is_geometry($old_field); return $out; } sub add_geometry_column { my ($field, $options) = @_; return sprintf( "INSERT INTO geometry_columns VALUES (%s,%s,%s,%s,%s,%s,%s)", map(__PACKAGE__->_quote_string($_), '', $field->table->schema->name, $options->{table} ? $options->{table} : $field->table->name, $field->name, $field->extra->{dimensions}, $field->extra->{srid}, $field->extra->{geometry_type}, ), ); } sub drop_geometry_column { my ($field) = @_; return sprintf("DELETE FROM geometry_columns WHERE f_table_schema = %s AND f_table_name = %s AND f_geometry_column = %s", map(__PACKAGE__->_quote_string($_), $field->table->schema->name, $field->table->name, $field->name,),); } sub add_geometry_constraints { my ($field, $options) = @_; return join(";\n", map { alter_create_constraint($_, $options) } create_geometry_constraints($field, $options)); } sub drop_geometry_constraints { my ($field, $options) = @_; return join(";\n", map { alter_drop_constraint($_, $options) } create_geometry_constraints($field, $options)); } sub alter_table { my ($to_table, $options) = @_; my $generator = _generator($options); my $out = sprintf('ALTER TABLE %s %s', $generator->quote($to_table->name), $options->{alter_table_action}); $out .= ";\n" . $options->{geometry_changes} if $options->{geometry_changes}; return $out; } sub rename_table { my ($old_table, $new_table, $options) = @_; my $generator = _generator($options); $options->{alter_table_action} = "RENAME TO " . $generator->quote($new_table); my @geometry_changes = map { drop_geometry_column($_, $options), add_geometry_column($_, { %{$options}, table => $new_table }), } grep { is_geometry($_) } $old_table->get_fields; $options->{geometry_changes} = join(";\n", @geometry_changes) if @geometry_changes; return alter_table($old_table, $options); } sub alter_create_index { my ($index, $options) = @_; my $generator = _generator($options); my ($idef, $constraints) = create_index($index, $options); return $index->type eq NORMAL ? $idef : sprintf('ALTER TABLE %s ADD %s', $generator->quote($index->table->name), join(q{}, @$constraints)); } sub alter_drop_index { my ($index, $options) = @_; return 'DROP INDEX ' . _generator($options)->quote($index->name); } sub alter_drop_constraint { my ($c, $options) = @_; my $generator = _generator($options); # NOT NULL constraint does not require a DROP CONSTRAINT statement if ($c->type eq NOT_NULL) { return; } # attention: Postgres has a very special naming structure for naming # foreign keys and primary keys. It names them using the name of the # table as prefix and fkey or pkey as suffix, concatenated by an underscore my $c_name; if ($c->name) { # Already has a name, just use it $c_name = $c->name; } else { # if the name is dotted we need the table, not schema nor database my ($tablename) = reverse split /[.]/, $c->table->name; if ($c->type eq FOREIGN_KEY) { # Doesn't have a name, and is foreign key, append '_fkey' $c_name = $tablename . '_' . ($c->fields)[0] . '_fkey'; } elsif ($c->type eq PRIMARY_KEY) { # Doesn't have a name, and is primary key, append '_pkey' $c_name = $tablename . '_pkey'; } } return sprintf('ALTER TABLE %s DROP CONSTRAINT %s', map { $generator->quote($_) } $c->table->name, $c_name,); } sub alter_create_constraint { my ($index, $options) = @_; my $generator = _generator($options); my ($defs, $fks) = create_constraint(@_); # return if there are no constraint definitions so we don't run # into output like this: # ALTER TABLE users ADD ; return unless (@{$defs} || @{$fks}); return $index->type eq FOREIGN_KEY ? join(q{}, @{$fks}) : join(' ', 'ALTER TABLE', $generator->quote($index->table->name), 'ADD', join(q{}, @{$defs}, @{$fks})); } sub drop_table { my ($table, $options) = @_; my $generator = _generator($options); my $out = "DROP TABLE " . $generator->quote($table) . " CASCADE"; my @geometry_drops = map { drop_geometry_column($_); } grep { is_geometry($_) } $table->get_fields; $out .= join(";\n", '', @geometry_drops) if @geometry_drops; return $out; } sub batch_alter_table { my ($table, $diff_hash, $options) = @_; # as long as we're not renaming the table we don't need to be here if (@{ $diff_hash->{rename_table} } == 0) { return batch_alter_table_statements($diff_hash, $options); } # first we need to perform drops which are on old table my @sql = batch_alter_table_statements( $diff_hash, $options, qw( alter_drop_constraint alter_drop_index drop_field ) ); # next comes the rename_table my $old_table = $diff_hash->{rename_table}[0][0]; push @sql, rename_table($old_table, $table, $options); # for alter_field (and so also rename_field) we need to make sure old # field has table name set to new table otherwise calling alter_field dies $diff_hash->{alter_field} = [ map { $_->[0]->table($table) && $_ } @{ $diff_hash->{alter_field} } ]; $diff_hash->{rename_field} = [ map { $_->[0]->table($table) && $_ } @{ $diff_hash->{rename_field} } ]; # now add everything else push @sql, batch_alter_table_statements( $diff_hash, $options, qw( add_field alter_field rename_field alter_create_index alter_create_constraint alter_table ) ); return @sql; } 1; # ------------------------------------------------------------------- # Life is full of misery, loneliness, and suffering -- # and it's all over much too soon. # Woody Allen # ------------------------------------------------------------------- =pod =head1 SEE ALSO SQL::Translator, SQL::Translator::Producer::Oracle. =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-1.66/lib/SQL/Translator/Producer/TT/0000755000000000000000000000000014716630506021712 5ustar00rootroot00000000000000SQL-Translator-1.66/lib/SQL/Translator/Producer/TT/Base.pm0000644000000000000000000002044314716630117023123 0ustar00rootroot00000000000000package SQL::Translator::Producer::TT::Base; =pod =head1 NAME SQL::Translator::Producer::TT::Base - TT (Template Toolkit) based Producer base class. =cut use strict; use warnings; our @EXPORT_OK; our $VERSION = '1.66'; use Template; use Data::Dumper; use IO::Handle; use Exporter; use base qw(Exporter); @EXPORT_OK = qw(produce); use SQL::Translator::Utils 'debug'; # Hack to convert the produce call into an object. ALL sub-classes need todo # this so that the correct class gets created. sub produce { return __PACKAGE__->new(translator => shift)->run; } sub new { my $proto = shift; my $class = ref $proto || $proto; my %args = @_; my $me = bless {}, $class; $me->{translator} = delete $args{translator} || die "Need a translator."; return $me; } sub translator { shift->{translator}; } sub schema { shift->{translator}->schema(@_); } # Util args access method. # No args - Return hashref (the actual hash in Translator) or hash of args. # 1 arg - Return that named args value. # Args - List of names. Return values of the given arg names in list context # or return as hashref in scalar context. Any names given that don't # exist in the args are returned as undef. sub args { my $me = shift; # No args unless (@_) { return wantarray ? %{ $me->{translator}->producer_args } : $me->{translator}->producer_args; } # 1 arg. Return the value whatever the context. return $me->{translator}->producer_args->{ $_[0] } if @_ == 1; # More args so return values list or hash ref my %args = %{ $me->{translator}->producer_args }; return wantarray ? @args{@_} : { map { ($_ => $args{$_}) } @_ }; } # Run the produce and return the result. sub run { my $me = shift; my $scma = $me->schema; my %args = %{ $me->args }; my $tmpl = $me->tt_schema or die "No template!"; debug "Processing template $tmpl\n"; my $out; my $tt = Template->new( #DEBUG => $me->translator->debug, ABSOLUTE => 1, # Set so we can use from the command line sensibly RELATIVE => 1, # Maybe the cmd line code should set it! Security! $me->tt_config, # Hook for sub-classes to add config %args, # Allow any TT opts to be passed in the producer_args ) || die "Failed to initialize Template object: " . Template->error; $tt->process( $tmpl, { $me->tt_default_vars, $me->tt_vars, # Sub-class hook for adding vars }, \$out ) or die "Error processing template '$tmpl': " . $tt->error; return $out; } # Sub class hooks #----------------------------------------------------------------------------- sub tt_config { () } sub tt_schema { my $me = shift; my $class = ref $me; my $file = $me->args("ttfile"); return $file if $file; no strict 'refs'; my $ref = *{"$class\:\:DATA"}{IO}; if ($ref->opened) { local $/ = undef; # Slurp mode return \<$ref>; } undef; } sub tt_default_vars { my $me = shift; return ( translator => $me->translator, schema => $me->pre_process_schema($me->translator->schema), ); } sub pre_process_schema { $_[1] } sub tt_vars { () } 1; =pod =head1 SYNOPSIS # Create a producer using a template in the __DATA__ section. package SQL::Translator::Producer::Foo; use base qw/SQL::Translator::Producer::TT::Base/; # Convert produce call into a method call on our new class sub produce { return __PACKAGE__->new( translator => shift )->run; }; # Configure the Template object. sub tt_config { ( INTERPOLATE => 1 ); } # Extra vars to add to the template sub tt_vars { ( foo => "bar" ); } # Put template in DATA section (or use file with ttfile producer arg) __DATA__ Schema Database: [% schema.database %] Foo: $foo ... =head1 DESCRIPTION A base class producer designed to be sub-classed to create new TT based producers cheaply - by simply giving the template to use and sprinkling in some extra template variables and config. You can find an introduction to this module in L. The 1st thing the module does is convert the produce sub routine call we get from SQL::Translator into a method call on an object, which we can then sub-class. This is done with the following code which needs to appear in B sub classes. # Convert produce call into an object method call sub produce { return __PACKAGE__->new( translator => shift )->run; }; See L below for details. The upshot of this is we can make new template producers by sub classing this base class, adding the above snippet and a template. The module also provides a number of hooks into the templating process, see L for details. See the L above for an example of creating a simple producer using a single template stored in the producers DATA section. =head1 SUB CLASS HOOKS Sub-classes can override these methods to control the templating by giving the template source, adding variables and giving config to the Tempate object. =head2 tt_config sub tt_config { ( INTERPOLATE => 1 ); } Return hash of Template config to add to that given to the L