SQL-Translator-0.11021/0000755000175000017500000000000012462421250013756 5ustar ilmariilmariSQL-Translator-0.11021/lib/0000755000175000017500000000000012462421250014524 5ustar ilmariilmariSQL-Translator-0.11021/lib/Test/0000755000175000017500000000000012462421250015443 5ustar ilmariilmariSQL-Translator-0.11021/lib/Test/SQL/0000755000175000017500000000000012462421250016102 5ustar ilmariilmariSQL-Translator-0.11021/lib/Test/SQL/Translator.pm0000644000175000017500000004326512354235344020612 0ustar ilmariilmaripackage Test::SQL::Translator; =pod =head1 NAME Test::SQL::Translator - Test::More test functions for the Schema objects. =cut use strict; use warnings; use Test::More; use SQL::Translator::Schema::Constants; use base qw(Exporter); our @EXPORT_OK; our $VERSION = '1.59'; our @EXPORT = qw( schema_ok table_ok field_ok constraint_ok index_ok view_ok trigger_ok procedure_ok maybe_plan ); # $ATTRIBUTES{ } = { => , ... } my %ATTRIBUTES = ( field => { name => undef, data_type => '', default_value => undef, size => '0', is_primary_key => 0, is_unique => 0, is_nullable => 1, is_foreign_key => 0, is_auto_increment => 0, comments => '', extra => {}, # foreign_key_reference, is_valid => 1, # order }, constraint => { name => '', type => '', deferrable => 1, expression => '', is_valid => 1, fields => [], match_type => '', options => [], on_delete => '', on_update => '', reference_fields => [], reference_table => '', extra => {}, }, index => { fields => [], is_valid => 1, name => "", options => [], type => NORMAL, extra => {}, }, view => { name => "", sql => "", fields => [], is_valid => 1, extra => {}, }, trigger => { name => '', perform_action_when => undef, database_events => undef, on_table => undef, action => undef, is_valid => 1, extra => {}, }, procedure => { name => '', sql => '', parameters => [], owner => '', comments => '', extra => {}, }, table => { comments => undef, name => '', #primary_key => undef, # pkey constraint options => [], #order => 0, fields => undef, constraints => undef, indices => undef, is_valid => 1, extra => {}, }, schema => { name => '', database => '', procedures => undef, # [] when set tables => undef, # [] when set triggers => undef, # [] when set views => undef, # [] when set is_valid => 1, extra => {}, } ); # Given a test hash and schema object name set any attribute keys not present in # the test hash to their default value for that schema object type. # e.g. default_attribs( $test, "field" ); sub default_attribs { my ($hashref, $object_type) = @_; if ( !exists $ATTRIBUTES{ $object_type } ) { die "Can't add default attribs for unknown Schema " . "object type '$object_type'."; } for my $attr ( grep { !exists $hashref->{ $_ } } keys %{ $ATTRIBUTES{ $object_type } } ) { $hashref->{ $attr } = $ATTRIBUTES{ $object_type }{ $attr } } return $hashref; } # Format test name so it will prepend the test names used below. sub t_name { my $name = shift; $name ||= ""; $name = "$name - " if $name; return $name; } sub field_ok { my ($f1,$test,$name) = @_; my $t_name = t_name($name); default_attribs($test,"field"); unless ($f1) { fail " Field '$test->{name}' doesn't exist!"; # TODO Do a skip on the following tests. Currently the test counts wont # match at the end. So at least it fails. return; } my $full_name = $f1->table->name.".".$test->{name}; is( $f1->name, $test->{name}, "${t_name}Field '$full_name'" ); is( $f1->is_valid, $test->{is_valid}, "$t_name is ".($test->{is_valid} ? '' : 'not ').'valid' ); is( $f1->data_type, $test->{data_type}, "$t_name type is '$test->{data_type}'" ); is( $f1->size, $test->{size}, "$t_name size is '$test->{size}'" ); is( $f1->default_value, $test->{default_value}, "$t_name default value is " .(defined($test->{default_value}) ? "'$test->{default_value}'" : "UNDEF" ) ); is( $f1->is_nullable, $test->{is_nullable}, "$t_name ".($test->{is_nullable} ? 'can' : 'cannot').' be null' ); is( $f1->is_unique, $test->{is_unique}, "$t_name ".($test->{is_unique} ? 'can' : 'cannot').' be unique' ); is( $f1->is_primary_key, $test->{is_primary_key}, "$t_name is ".($test->{is_primary_key} ? '' : 'not ').'a primary_key' ); is( $f1->is_foreign_key, $test->{is_foreign_key}, "$t_name is ".($test->{is_foreign_key} ? '' : 'not').' a foreign_key' ); is( $f1->is_auto_increment, $test->{is_auto_increment}, "$t_name is " .($test->{is_auto_increment} ? '' : 'not ').'an auto_increment' ); is( $f1->comments, $test->{comments}, "$t_name comments" ); is_deeply( { $f1->extra }, $test->{extra}, "$t_name extra" ); } sub constraint_ok { my ($obj,$test,$name) = @_; my $t_name = t_name($name); default_attribs($test,"constraint"); is( $obj->name, $test->{name}, "${t_name}Constraint '$test->{name}'" ); is( $obj->type, $test->{type}, "$t_name type is '$test->{type}'" ); is( $obj->deferrable, $test->{deferrable}, "$t_name ".($test->{deferrable} ? 'can' : 'cannot').' be deferred' ); is( $obj->is_valid, $test->{is_valid}, "$t_name is ".($test->{is_valid} ? '' : 'not ').'valid' ); is($obj->table->name,$test->{table},"$t_name table is '$test->{table}'" ); is( $obj->expression, $test->{expression}, "$t_name expression is '$test->{expression}'" ); is_deeply( [$obj->fields], $test->{fields}, "$t_name fields are '".join(",",@{$test->{fields}})."'" ); is( $obj->reference_table, $test->{reference_table}, "$t_name reference_table is '$test->{reference_table}'" ); is_deeply( [$obj->reference_fields], $test->{reference_fields}, "$t_name reference_fields are '".join(",",@{$test->{reference_fields}})."'" ); is( $obj->match_type, $test->{match_type}, "$t_name match_type is '$test->{match_type}'" ); is( $obj->on_delete, $test->{on_delete}, "$t_name on_delete is '$test->{on_delete}'" ); is( $obj->on_update, $test->{on_update}, "$t_name on_update is '$test->{on_update}'" ); is_deeply( [$obj->options], $test->{options}, "$t_name options are '".join(",",@{$test->{options}})."'" ); is_deeply( { $obj->extra }, $test->{extra}, "$t_name extra" ); } sub index_ok { my ($obj,$test,$name) = @_; my $t_name = t_name($name); default_attribs($test,"index"); is( $obj->name, $test->{name}, "${t_name}Index '$test->{name}'" ); is( $obj->is_valid, $test->{is_valid}, "$t_name is ".($test->{is_valid} ? '' : 'not ').'valid' ); is( $obj->type, $test->{type}, "$t_name type is '$test->{type}'" ); is_deeply( [$obj->fields], $test->{fields}, "$t_name fields are '".join(",",@{$test->{fields}})."'" ); is_deeply( [$obj->options], $test->{options}, "$t_name options are '".join(",",@{$test->{options}})."'" ); is_deeply( { $obj->extra }, $test->{extra}, "$t_name extra" ); } sub trigger_ok { my ($obj,$test,$name) = @_; my $t_name = t_name($name); default_attribs($test,"index"); is( $obj->name, $test->{name}, "${t_name}Trigger '$test->{name}'" ); is( $obj->is_valid, $test->{is_valid}, "$t_name is ".($test->{is_valid} ? '' : 'not ').'valid' ); is( $obj->perform_action_when, $test->{perform_action_when}, "$t_name perform_action_when is '$test->{perform_action_when}'" ); is( join(',', $obj->database_events), $test->{database_events}, sprintf("%s database_events is '%s'", $t_name, $test->{'database_events'}, ) ); is( $obj->on_table, $test->{on_table}, "$t_name on_table is '$test->{on_table}'" ); is( $obj->action, $test->{action}, "$t_name action is '$test->{action}'" ); is_deeply( { $obj->extra }, $test->{extra}, "$t_name extra" ); } sub view_ok { my ($obj,$test,$name) = @_; my $t_name = t_name($name); default_attribs($test,"index"); #isa_ok( $v, 'SQL::Translator::Schema::View', 'View' ); is( $obj->name, $test->{name}, "${t_name}View '$test->{name}'" ); is( $obj->is_valid, $test->{is_valid}, "$t_name is ".($test->{is_valid} ? '' : 'not ').'valid' ); is( $obj->sql, $test->{sql}, "$t_name sql is '$test->{sql}'" ); is_deeply( [$obj->fields], $test->{fields}, "$t_name fields are '".join(",",@{$test->{fields}})."'" ); is_deeply( { $obj->extra }, $test->{extra}, "$t_name extra" ); } sub procedure_ok { my ($obj,$test,$name) = @_; my $t_name = t_name($name); default_attribs($test,"index"); #isa_ok( $v, 'SQL::Translator::Schema::View', 'View' ); is( $obj->name, $test->{name}, "${t_name}Procedure '$test->{name}'" ); is( $obj->sql, $test->{sql}, "$t_name sql is '$test->{sql}'" ); is_deeply( [$obj->parameters], $test->{parameters}, "$t_name parameters are '".join(",",@{$test->{parameters}})."'" ); is( $obj->comments, $test->{comments}, "$t_name comments is '$test->{comments}'" ); is( $obj->owner, $test->{owner}, "$t_name owner is '$test->{owner}'" ); is_deeply( { $obj->extra }, $test->{extra}, "$t_name extra" ); } sub table_ok { my ($obj,$test,$name) = @_; my $t_name = t_name($name); default_attribs($test,"table"); my %arg = %$test; my $tbl_name = $arg{name} || die "Need a table name to test."; is( $obj->{name}, $arg{name}, "${t_name}Table '$arg{name}'" ); is_deeply( [$obj->options], $test->{options}, "$t_name options are '".join(",",@{$test->{options}})."'" ); is_deeply( { $obj->extra }, $test->{extra}, "$t_name extra" ); # Fields if ( $arg{fields} ) { my @fldnames = map {$_->{name}} @{$arg{fields}}; is_deeply( [ map {$_->name} $obj->get_fields ], [ @fldnames ], "${t_name} field names are ".join(", ",@fldnames) ); foreach ( @{$arg{fields}} ) { my $f_name = $_->{name} || die "Need a field name to test."; next unless my $fld = $obj->get_field($f_name); field_ok( $fld, $_, $name ); } } else { is(scalar($obj->get_fields), undef, "${t_name} has no fields."); } # Constraints and Indices _test_kids($obj, $test, $name, { constraint => 'constraints', index => 'indices', }); } sub _test_kids { my ( $obj, $test, $name, $kids ) = @_; my $t_name = t_name($name); my $obj_name = ref $obj; ($obj_name) = $obj_name =~ m/^.*::(.*)$/; while ( my ( $object_type, $plural ) = each %$kids ) { next unless defined $test->{ $plural }; if ( my @tests = @{ $test->{ $plural } } ) { my $meth = "get_$plural"; my @objects = $obj->$meth; is( scalar(@objects), scalar(@tests), "${t_name}$obj_name has " . scalar(@tests) . " $plural" ); for my $object (@objects) { my $ans = { lc($obj_name) => $obj->name, %{ shift @tests } }; my $meth = "${object_type}_ok"; { no strict 'refs'; $meth->( $object, $ans, $name ); } } } } } sub schema_ok { my ($obj,$test,$name) = @_; my $t_name = t_name($name); default_attribs($test,"schema"); is( $obj->name, $test->{name}, "${t_name}Schema name is '$test->{name}'" ); is( $obj->database, $test->{database}, "$t_name database is '$test->{database}'" ); is_deeply( { $obj->extra }, $test->{extra}, "$t_name extra" ); is( $obj->is_valid, $test->{is_valid}, "$t_name is ".($test->{is_valid} ? '' : 'not ').'valid' ); # Tables if ( $test->{tables} ) { is_deeply( [ map {$_->name} $obj->get_tables ], [ map {$_->{name}} @{$test->{tables}} ], "${t_name} table names match" ); foreach ( @{$test->{tables}} ) { my $t_name = $_->{name} || die "Need a table name to test."; table_ok( $obj->get_table($t_name), $_, $name ); } } else { is(scalar($obj->get_tables), undef, "${t_name} has no tables."); } # Procedures, Triggers, Views _test_kids($obj, $test, $name, { procedure => 'procedures', trigger => 'triggers', view => 'views', }); } # maybe_plan($ntests, @modules) # # Calls plan $ntests if @modules can all be loaded; otherwise, # calls skip_all with an explanation of why the tests were skipped. sub maybe_plan { my ($ntests, @modules) = @_; my @errors; for my $module (@modules) { eval "use $module;"; next if !$@; if ($@ =~ /Can't locate (\S+)/) { my $mod = $1; $mod =~ s/\.pm$//; $mod =~ s#/#::#g; push @errors, $mod; } elsif ($@ =~ /([\w\:]+ version [\d\.]+) required.+?this is only version/) { push @errors, $1; } } if (@errors) { my $msg = sprintf "Missing dependenc%s: %s", @errors == 1 ? 'y' : 'ies', join ", ", @errors; plan skip_all => $msg; } return unless defined $ntests; if ($ntests ne 'no_plan') { plan tests => $ntests; } else { plan 'no_plan'; } } 1; # compile please =========================================================== __END__ =pod =head1 SYNOPSIS # t/magic.t use FindBin '$Bin'; use Test::More; use Test::SQL::Translator; # Run parse my $sqlt = SQL::Translator->new( parser => "Magic", filename => "$Bin/data/magic/test.magic", ... ); ... my $schema = $sqlt->schema; # Test the table it produced. table_ok( $schema->get_table("Customer"), { name => "Customer", fields => [ { name => "CustomerID", data_type => "INT", size => 12, default_value => undef, is_nullable => 0, is_primary_key => 1, }, { name => "bar", data_type => "VARCHAR", size => 255, is_nullable => 0, }, ], constraints => [ { type => "PRIMARY KEY", fields => "CustomerID", }, ], indices => [ { name => "barindex", fields => ["bar"], }, ], }); =head1 DESCSIPTION Provides a set of Test::More tests for Schema objects. Testing a parsed schema is then as easy as writing a perl data structure describing how you expect the schema to look. Also provides maybe_plan for conditionally running tests based on their dependencies. The data structures given to the test subs don't have to include all the possible values, only the ones you expect to have changed. Any left out will be tested to make sure they are still at their default value. This is a useful check that you your parser hasn't accidentally set schema values you didn't expect it to. For an example of the output run the t/16xml-parser.t test. =head1 Tests All the tests take a first arg of the schema object to test, followed by a hash ref describing how you expect that object to look (you only need give the attributes you expect to have changed from the default). The 3rd arg is an optional test name to pre-pend to all the generated test names. =head2 table_ok =head2 field_ok =head2 constraint_ok =head2 index_ok =head2 view_ok =head2 trigger_ok =head2 procedure_ok =head1 CONDITIONAL TESTS The C function handles conditionally running an individual test. It is here to enable running the test suite even when dependencies are missing; not having (for example) GraphViz installed should not keep the test suite from passing. C takes the number of tests to (maybe) run, and a list of modules on which test execution depends: maybe_plan(180, 'SQL::Translator::Parser::MySQL'); If one of C's dependencies does not exist, then the test will be skipped. Instead of a number of tests, you can pass C if you're using C, or C<'no_plan'> if you don't want a plan at all. =head1 EXPORTS table_ok, field_ok, constraint_ok, index_ok, view_ok, trigger_ok, procedure_ok, maybe_plan =head1 TODO =over 4 =item Test the tests! =item Test Count Constants Constants to give the number of tests each *_ok sub uses. e.g. How many tests does field_ok run? Can then use these to set up the test plan easily. =item Test skipping As the test subs wrap up lots of tests in one call you can't skip individual tests only whole sets e.g. a whole table or field. We could add skip_* items to the test hashes to allow per test skips. e.g. skip_is_primary_key => "Need to fix primary key parsing.", =item yaml test specs Maybe have the test subs also accept yaml for the test hash ref as its a much nicer for writing big data structures. We can then define tests as in input schema file and test yaml file to compare it against. =back =head1 BUGS =head1 AUTHOR Mark D. Addison Emark.addison@itn.co.ukE, Darren Chamberlain . Thanks to Ken Y. Clark for the original table and field test code taken from his mysql test. =head1 SEE ALSO perl(1), SQL::Translator, SQL::Translator::Schema, Test::More. =cut SQL-Translator-0.11021/lib/SQL/0000755000175000017500000000000012462421250015163 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator.pm0000644000175000017500000010316212462420616017662 0ustar ilmariilmaripackage SQL::Translator; use Moo; our ( $DEFAULT_SUB, $DEBUG, $ERROR ); our $VERSION = '0.11021'; $DEBUG = 0 unless defined $DEBUG; $ERROR = ""; use Carp qw(carp croak); use Data::Dumper; use File::Find; use File::Spec::Functions qw(catfile); use File::Basename qw(dirname); use IO::Dir; use Sub::Quote qw(quote_sub); use SQL::Translator::Producer; use SQL::Translator::Schema; use SQL::Translator::Utils qw(throw ex2err carp_ro normalize_quote_options); $DEFAULT_SUB = sub { $_[0]->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"); $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"); # 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-0.11021/lib/SQL/Translator/0000755000175000017500000000000012462421250017314 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Role/0000755000175000017500000000000012462421250020215 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Role/BuildArgs.pm0000644000175000017500000000124312163313615022432 0ustar ilmariilmaripackage 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-0.11021/lib/SQL/Translator/Role/ListAttr.pm0000644000175000017500000000562412163313615022333 0ustar ilmariilmaripackage SQL::Translator::Role::ListAttr; =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 strictures 1; use SQL::Translator::Utils qw(parse_list_arg ex2err); use List::MoreUtils qw(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-0.11021/lib/SQL/Translator/Role/Error.pm0000644000175000017500000000304112163313615021645 0ustar ilmariilmaripackage 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-0.11021/lib/SQL/Translator/Role/Debug.pm0000644000175000017500000000145712163313615021613 0ustar ilmariilmaripackage 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-0.11021/lib/SQL/Translator/Manual.pod0000644000175000017500000004547612221056401021250 0ustar ilmariilmari=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-0.11021/lib/SQL/Translator/Filter/0000755000175000017500000000000012462421250020541 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Filter/DefaultExtra.pm0000644000175000017500000000307712163313615023501 0ustar ilmariilmaripackage SQL::Translator::Filter::DefaultExtra; =head1 NAME SQL::Translator::Filter::DefaultExtra - Set default extra data values for schema objects. =head1 SYNOPSIS use SQL::Translator; my $sqlt = SQL::Translator->new( from => 'MySQL', to => 'MySQL', filters => [ DefaultExtra => { # XXX - These should really be ordered # Default widget for fields to basic text edit. 'field.widget' => 'text', # idea: 'field(data_type=BIT).widget' => 'yesno', # Default label (human formated name) for fields and tables 'field.label' => '=ucfirst($name)', 'table.label' => '=ucfirst($name)', }, ], ) || die "SQLFairy error : ".SQL::Translator->error; my $sql = $sqlt->translate || die "SQLFairy error : ".$sqlt->error; =cut use strict; use warnings; our $VERSION = '1.59'; sub filter { my $schema = shift; my %args = { +shift }; # Tables foreach ( $schema->get_tables ) { my %extra = $_->extra; $extra{label} ||= ucfirst($_->name); $_->extra( %extra ); } # Fields foreach ( map { $_->get_fields } $schema->get_tables ) { my %extra = $_->extra; $extra{label} ||= ucfirst($_->name); $_->extra( %extra ); } } 1; __END__ =head1 DESCRIPTION Maybe I'm trying to do too much in one go. Args set a match and then an update, if you want to set lots of things, use lots of filters! =head1 SEE ALSO L, L =head1 BUGS =head1 TODO =head1 AUTHOR =cut SQL-Translator-0.11021/lib/SQL/Translator/Filter/Names.pm0000644000175000017500000000665712163313615022163 0ustar ilmariilmaripackage SQL::Translator::Filter::Names; =head1 NAME SQL::Translator::Filter::Names - Tweak the names of schema objects. =head1 SYNOPSIS #! /usr/bin/perl -w use SQL::Translator; # Lowercase all table names and upper case the first letter of all field # names. (MySql style!) # my $sqlt = SQL::Translator->new( filename => \@ARGV, from => 'MySQL', to => 'MySQL', filters => [ Names => { 'tables' => 'lc', 'fields' => 'ucfirst', }, ], ) || die "SQLFairy error : ".SQL::Translator->error; print($sqlt->translate) || die "SQLFairy error : ".$sqlt->error; =cut use strict; use warnings; our $VERSION = '1.59'; sub filter { my $schema = shift; my %args = %{$_[0]}; # Tables #if ( my $func = $args{tables} ) { # _filtername($_,$func) foreach ( $schema->get_tables ); #} # , foreach my $type ( qw/tables procedures triggers views/ ) { if ( my $func = $args{$type} ) { my $meth = "get_$type"; _filtername($_,$func) foreach $schema->$meth; } } # Fields if ( my $func = $args{fields} ) { _filtername($_,$func) foreach map { $_->get_fields } $schema->get_tables ; } } # _filtername( OBJ, FUNC_NAME ) # Update the name attribute on the schema object given using the named filter. # Objects with no name are skipped. # Returns true if the name was changed. Dies if there is an error running func. sub _filtername { my ($obj,$func) = @_; return unless my $name = $obj->name; $func = _getfunc($func); my $newname = eval { $func->($name) }; die "$@" if $@; # TODO - Better message! return if $name eq $newname; $_->name($newname); } # _getfunc( NAME ) - Returns code ref to func NAME or dies. sub _getfunc { my ($name) = @_; no strict 'refs'; my $func = "SQL::Translator::Filter::Names::$name"; die "Table name filter - unknown function '$name'\n" unless exists &$func; \&$func; } # The name munging functions #============================================================================= # Get called with name to munge as first arg and return the new name. Die on # errors. sub lc { lc shift; } sub uc { uc shift; } sub ucfirst { ucfirst shift; } 1; #========================================================================== __END__ =head1 DESCRIPTION =head1 SEE ALSO L, L =head1 BUGS =head1 TODO =over 4 =item Name Groups Define a bunch of useful groups to run the name filters over. e.g. all, fkeys, pkeys etc. =item More Functions e.g. camelcase, titlecase, single word etc. Also a way to pass in a regexp. May also want a way to pass in arguments for the func e.g. prefix. =item Multiple Filters on the same name (filter order)? Do we actually need this, you could just run lots of filters. Would make adding func args to the interface easier. filters => [ [ 'Names', { all => 'lc' } ], [ 'Names', { tables => 'lc', fields => 'ucfirst', } ], ], Mind you if you could give the filter a list this wouldn't be a problem! filters => [ [ 'Names', all => 'lc' fields => 'ucfirst', ], ], Which is nice. Might have to change the calling conventions for filters. Would also provide an order to run the filters in rather than having to hard code it into the filter it's self. =back =head1 AUTHOR =cut SQL-Translator-0.11021/lib/SQL/Translator/Filter/Globals.pm0000644000175000017500000001206312221056401022457 0ustar ilmariilmaripackage SQL::Translator::Filter::Globals; =head1 NAME SQL::Translator::Filter::Globals - Add global fields and indices to all tables. =head1 SYNOPSIS # e.g. Add timestamp field to all tables. use SQL::Translator; my $sqlt = SQL::Translator->new( from => 'MySQL', to => 'MySQL', filters => [ Globals => { fields => [ { name => 'modified' data_type => 'TIMESTAMP' } ], indices => [ { fields => 'modifed', }, ] constraints => [ { } ] }, ], ) || die "SQLFairy error : ".SQL::Translator->error; my $sql = $sqlt->translate || die "SQLFairy error : ".$sqlt->error; =cut use strict; use warnings; our $VERSION = '1.59'; sub filter { my $schema = shift; my %args = @_; my $global_table = $args{global_table} ||= '_GLOBAL_'; my (@global_fields, @global_indices, @global_constraints); push @global_fields, @{ $args{fields} } if $args{fields}; push @global_indices, @{ $args{indices} } if $args{indices}; push @global_constraints, @{ $args{constraints} } if $args{constraints}; # Pull fields and indices off global table and then remove it. if ( my $gtbl = $schema->get_table( $global_table ) ) { foreach ( $gtbl->get_fields ) { # We don't copy the order attrib so the added fields should get # pushed on the end of each table. push @global_fields, { name => $_->name, comments => "".$_->comments, data_type => $_->data_type, default_value => $_->default_value, size => [$_->size], extra => scalar($_->extra), foreign_key_reference => $_->foreign_key_reference, is_auto_increment => $_->is_auto_increment, is_foreign_key => $_->is_foreign_key, is_nullable => $_->is_nullable, is_primary_key => $_->is_primary_key, is_unique => $_->is_unique, is_valid => $_->is_valid, }; } foreach ( $gtbl->get_indices ) { push @global_indices, { name => $_->name, type => $_->type, fields => [$_->fields], options => [$_->options], extra => scalar($_->extra), }; } foreach ( $gtbl->get_constraints ) { push @global_constraints, { name => $_->name, fields => [$_->fields], deferrable => $_->deferrable, expression => $_->expression, match_type => $_->match_type, options => [$_->options], on_delete => $_->on_delete, on_update => $_->on_update, reference_fields => [$_->reference_fields], reference_table => $_->reference_table, table => $_->table, type => $_->type, extra => scalar($_->extra), }; } $schema->drop_table($gtbl); } # Add globals to tables foreach my $tbl ( $schema->get_tables ) { foreach my $new_fld ( @global_fields ) { # Don't add if field already there next if $tbl->get_field( $new_fld->{name} ); $tbl->add_field( %$new_fld ); } foreach my $new_index ( @global_indices ) { $tbl->add_index( %$new_index ); } foreach my $new_constraint ( @global_constraints ) { $tbl->add_constraint( %$new_constraint ); } } } 1; __END__ =head1 DESCRIPTION Adds global fields, indices and constraints to all tables in the schema. The globals to add can either be defined in the filter args or using a _GLOBAL_ table (see below). If a table already contains a field with the same name as a global then it is skipped for that table. =head2 The _GLOBAL_ Table An alternative to using the args is to add a table called C<_GLOBAL_> to the schema and then just use the filter. Any fields and indices defined on this table will be added to all the tables in the schema and the _GLOBAL_ table removed. The name of the global can be changed using a C arg to the filter. =head1 SEE ALSO L, L =head1 BUGS Will generate duplicate indices if an index already exists on a table the same as one added globally. Will generate duplicate constraints if a constraint already exists on a table the same as one added globally. =head1 TODO Some extra data values that can be used to control the global addition. e.g. 'skip_global'. =head1 AUTHOR Mark Addison =cut SQL-Translator-0.11021/lib/SQL/Translator/Producer.pm0000644000175000017500000000527112421750412021442 0ustar ilmariilmaripackage SQL::Translator::Producer; use strict; use warnings; use Scalar::Util (); our $VERSION = '1.59'; sub produce { "" } # Do not rely on this if you are not bundled with SQL::Translator. # -- rjbs, 2008-09-30 ## $exceptions contains an arrayref of paired values ## Each pair contains a pattern match or string, and a value to be used as ## the default if matched. ## They are special per Producer, and provide support for the old 'now()' ## default value exceptions sub _apply_default_value { my ($self, $field, $field_ref, $exceptions) = @_; my $default = $field->default_value; return if !defined $default; if ($exceptions and ! ref $default) { for (my $i = 0; $i < @$exceptions; $i += 2) { my ($pat, $val) = @$exceptions[ $i, $i + 1 ]; if (ref $pat and $default =~ $pat) { $default = $val; last; } elsif (lc $default eq lc $pat) { $default = $val; last } } } my $type = lc $field->data_type; my $is_numeric_datatype = ($type =~ /^(?:(?:big|medium|small|tiny)?int(?:eger)?|decimal|double|float|num(?:ber|eric)?|real)$/); if (ref $default) { $$field_ref .= " DEFAULT $$default"; } elsif ($is_numeric_datatype && Scalar::Util::looks_like_number ($default) ) { # we need to check the data itself in addition to the datatype, for basic safety $$field_ref .= " DEFAULT $default"; } else { $default = $self->_quote_string($default); $$field_ref .= " DEFAULT $default"; } } sub _quote_string { my ($self, $string) = @_; $string =~ s/'/''/g; return qq{'$string'}; } 1; # ------------------------------------------------------------------- # A burnt child loves the fire. # Oscar Wilde # ------------------------------------------------------------------- =pod =head1 NAME SQL::Translator::Producer - describes how to write a producer =head1 DESCRIPTION Producer modules designed to be used with SQL::Translator need to implement a single function, called B. B will be called with the SQL::Translator object from which it is expected to retrieve the SQL::Translator::Schema object which has been populated by the parser. It is expected to return a string. =head1 METHODS =over 4 =item produce =item create_table($table) =item create_field($field) =item create_view($view) =item create_index($index) =item create_constraint($constraint) =item create_trigger($trigger) =item alter_field($from_field, $to_field) =item add_field($table, $new_field) =item drop_field($table, $old_field) =back =head1 AUTHORS Darren Chamberlain Edarren@cpan.orgE, Ken Y. Clark Ekclark@cpan.orgE. =head1 SEE ALSO perl(1), SQL::Translator, SQL::Translator::Schema. =cut SQL-Translator-0.11021/lib/SQL/Translator/Parser.pm0000644000175000017500000000274112163313615021115 0ustar ilmariilmaripackage SQL::Translator::Parser; use strict; use warnings; our $VERSION = '1.60'; 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-0.11021/lib/SQL/Translator/Schema/0000755000175000017500000000000012462421250020514 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Schema/Role/0000755000175000017500000000000012462421250021415 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Schema/Role/Extra.pm0000644000175000017500000000356612221056401023043 0ustar ilmariilmaripackage SQL::Translator::Schema::Role::Extra; =head1 NAME SQL::Translator::Schema::Role::Extra - "extra" attribute for schema classes =head1 SYNOPSIS package Foo; use Moo; with qw(SQL::Translator::Schema::Role::Extra); =head1 DESCRIPTION This role provides methods to set and get a hashref of extra attributes for schema objects. =cut use Moo::Role; use Sub::Quote qw(quote_sub); =head1 METHODS =head2 extra Get or set the objects "extra" attributes (e.g., "ZEROFILL" for MySQL fields). Call with no args to get all the extra data. Call with a single name arg to get the value of the named extra attribute, returned as a scalar. Call with a hash or hashref to set extra attributes. Returns a hash or a hashref. $field->extra( qualifier => 'ZEROFILL' ); $qualifier = $field->extra('qualifier'); %extra = $field->extra; $extra = $field->extra; =cut has extra => ( is => 'rwp', default => quote_sub(q{ +{} }) ); around extra => sub { my ($orig, $self) = (shift, shift); @_ = %{$_[0]} if ref $_[0] eq "HASH"; my $extra = $self->$orig; if (@_==1) { return $extra->{$_[0]}; } elsif (@_) { my %args = @_; while ( my ( $key, $value ) = each %args ) { $extra->{$key} = $value; } } return wantarray ? %$extra : $extra; }; =head2 remove_extra L can only be used to get or set "extra" attributes but not to remove some. Call with no args to remove all extra attributes that have been set before. Call with a list of key names to remove certain extra attributes only. # remove all extra attributes $field->remove_extra(); # remove timezone and locale attributes only $field->remove_extra(qw/timezone locale/); =cut sub remove_extra { my ( $self, @keys ) = @_; unless (@keys) { $self->_set_extra({}); } else { delete @{$self->extra}{@keys}; } } 1; SQL-Translator-0.11021/lib/SQL/Translator/Schema/Role/Compare.pm0000644000175000017500000000236412163313615023351 0ustar ilmariilmaripackage SQL::Translator::Schema::Role::Compare; =head1 NAME SQL::Translator::Schema::Role::Compare - compare objects =head1 SYNOPSIS package Foo; use Moo; with qw(SQL::Translator::Schema::Role::Compare); $obj->equals($other); =head1 DESCRIPTION This L provides a method to compare if two objects are the same. =cut use Moo::Role; =head1 METHODS =head2 equals Determines if this object is the same as another. my $isIdentical = $object1->equals( $object2 ); =cut sub equals { my $self = shift; my $other = shift; return 0 unless $other; return 1 if overload::StrVal($self) eq overload::StrVal($other); return 0 unless $other->isa( ref($self) ); return 1; } sub _compare_objects { # my ($self, $obj1, $obj2) = @_; my $result = ( Data::Dumper->new([$_[1]])->Terse(1)->Indent(0)->Deparse(1)->Sortkeys(1)->Maxdepth(0)->Dump eq Data::Dumper->new([$_[2]])->Terse(1)->Indent(0)->Deparse(1)->Sortkeys(1)->Maxdepth(0)->Dump ); # if ( !$result ) { # use Carp qw(cluck); # cluck("How did I get here?"); # use Data::Dumper; # $Data::Dumper::Maxdepth = 1; # print "obj1: ", Dumper($obj1), "\n"; # print "obj2: ", Dumper($obj2), "\n"; # } return $result; } 1; SQL-Translator-0.11021/lib/SQL/Translator/Schema/Constraint.pm0000644000175000017500000002753612411004141023201 0ustar ilmariilmaripackage SQL::Translator::Schema::Constraint; =pod =head1 NAME SQL::Translator::Schema::Constraint - SQL::Translator constraint object =head1 SYNOPSIS use SQL::Translator::Schema::Constraint; my $constraint = SQL::Translator::Schema::Constraint->new( name => 'foo', fields => [ id ], type => PRIMARY_KEY, ); =head1 DESCRIPTION C is the constraint object. =head1 METHODS =cut use Moo; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(ex2err throw); use SQL::Translator::Role::ListAttr; use SQL::Translator::Types qw(schema_obj enum); use Sub::Quote qw(quote_sub); extends 'SQL::Translator::Schema::Object'; our $VERSION = '1.59'; my %VALID_CONSTRAINT_TYPE = ( PRIMARY_KEY, 1, UNIQUE, 1, CHECK_C, 1, FOREIGN_KEY, 1, NOT_NULL, 1, ); =head2 new Object constructor. my $schema = SQL::Translator::Schema::Constraint->new( table => $table, # table to which it belongs type => 'foreign_key', # type of table constraint name => 'fk_phone_id', # name of the constraint fields => 'phone_id', # field in the referring table reference_fields => 'phone_id', # referenced field reference_table => 'phone', # referenced table match_type => 'full', # how to match on_delete => 'cascade', # what to do on deletes on_update => '', # what to do on updates ); =cut # Override to remove empty arrays from args. # t/14postgres-parser breaks without this. around BUILDARGS => sub { my $orig = shift; my $self = shift; my $args = $self->$orig(@_); foreach my $arg (keys %{$args}) { delete $args->{$arg} if ref($args->{$arg}) eq "ARRAY" && !@{$args->{$arg}}; } if (exists $args->{fields}) { $args->{field_names} = delete $args->{fields}; } return $args; }; =head2 deferrable Get or set whether the constraint is deferrable. If not defined, then returns "1." The argument is evaluated by Perl for True or False, so the following are equivalent: $deferrable = $field->deferrable(0); $deferrable = $field->deferrable(''); $deferrable = $field->deferrable('0'); =cut has deferrable => ( is => 'rw', coerce => quote_sub(q{ $_[0] ? 1 : 0 }), default => quote_sub(q{ 1 }), ); =head2 expression Gets and set the expression used in a CHECK constraint. my $expression = $constraint->expression('...'); =cut has expression => ( is => 'rw', default => quote_sub(q{ '' }) ); around expression => sub { my ($orig, $self, $arg) = @_; $self->$orig($arg || ()); }; sub is_valid { =pod =head2 is_valid Determine whether the constraint is valid or not. my $ok = $constraint->is_valid; =cut my $self = shift; my $type = $self->type or return $self->error('No type'); my $table = $self->table or return $self->error('No table'); my @fields = $self->fields or return $self->error('No fields'); my $table_name = $table->name or return $self->error('No table name'); for my $f ( @fields ) { next if $table->get_field( $f ); return $self->error( "Constraint references non-existent field '$f' ", "in table '$table_name'" ); } my $schema = $table->schema or return $self->error( 'Table ', $table->name, ' has no schema object' ); if ( $type eq FOREIGN_KEY ) { return $self->error('Only one field allowed for foreign key') if scalar @fields > 1; my $ref_table_name = $self->reference_table or return $self->error('No reference table'); my $ref_table = $schema->get_table( $ref_table_name ) or return $self->error("No table named '$ref_table_name' in schema"); my @ref_fields = $self->reference_fields or return; return $self->error('Only one field allowed for foreign key reference') if scalar @ref_fields > 1; for my $ref_field ( @ref_fields ) { next if $ref_table->get_field( $ref_field ); return $self->error( "Constraint from field(s) ". join(', ', map {qq['$table_name.$_']} @fields). " to non-existent field '$ref_table_name.$ref_field'" ); } } elsif ( $type eq CHECK_C ) { return $self->error('No expression for CHECK') unless $self->expression; } return 1; } =head2 fields Gets and set the fields the constraint is on. Accepts a string, list or arrayref; returns an array or array reference. Will unique the field names and keep them in order by the first occurrence of a field name. The fields are returned as Field objects if they exist or as plain names if not. (If you just want the names and want to avoid the Field's overload magic use L). Returns undef or an empty list if the constraint has no fields set. $constraint->fields('id'); $constraint->fields('id', 'name'); $constraint->fields( 'id, name' ); $constraint->fields( [ 'id', 'name' ] ); $constraint->fields( qw[ id name ] ); my @fields = $constraint->fields; =cut sub fields { my $self = shift; my $table = $self->table; my @fields = map { $table->get_field($_) || $_ } @{$self->field_names(@_) || []}; return wantarray ? @fields : @fields ? \@fields : undef; } =head2 field_names Read-only method to return a list or array ref of the field names. Returns undef or an empty list if the constraint has no fields set. Useful if you want to avoid the overload magic of the Field objects returned by the fields method. my @names = $constraint->field_names; =cut with ListAttr field_names => ( uniq => 1, undef_if_empty => 1 ); =head2 match_type Get or set the constraint's match_type. Only valid values are "full" "partial" and "simple" my $match_type = $constraint->match_type('FULL'); =cut has match_type => ( is => 'rw', default => quote_sub(q{ '' }), coerce => quote_sub(q{ lc $_[0] }), isa => enum([qw(full partial simple)], { msg => "Invalid match type: %s", allow_false => 1, }), ); around match_type => \&ex2err; =head2 name Get or set the constraint's name. my $name = $constraint->name('foo'); =cut has name => ( is => 'rw', default => quote_sub(q{ '' }) ); around name => sub { my ($orig, $self, $arg) = @_; $self->$orig($arg || ()); }; =head2 options Gets or adds to the constraints's options (e.g., "INITIALLY IMMEDIATE"). Returns an array or array reference. $constraint->options('NORELY'); my @options = $constraint->options; =cut with ListAttr options => (); =head2 on_delete Get or set the constraint's "on delete" action. my $action = $constraint->on_delete('cascade'); =cut has on_delete => ( is => 'rw', default => quote_sub(q{ '' }) ); around on_delete => sub { my ($orig, $self, $arg) = @_; $self->$orig($arg || ()); }; =head2 on_update Get or set the constraint's "on update" action. my $action = $constraint->on_update('no action'); =cut has on_update => ( is => 'rw', default => quote_sub(q{ '' }) ); around on_update => sub { my ($orig, $self, $arg) = @_; $self->$orig($arg || ()); }; =head2 reference_fields Gets and set the fields in the referred table. Accepts a string, list or arrayref; returns an array or array reference. $constraint->reference_fields('id'); $constraint->reference_fields('id', 'name'); $constraint->reference_fields( 'id, name' ); $constraint->reference_fields( [ 'id', 'name' ] ); $constraint->reference_fields( qw[ id name ] ); my @reference_fields = $constraint->reference_fields; =cut with ListAttr reference_fields => ( may_throw => 1, builder => 1, lazy => 1, ); sub _build_reference_fields { my ($self) = @_; my $table = $self->table or throw('No table'); my $schema = $table->schema or throw('No schema'); if ( my $ref_table_name = $self->reference_table ) { my $ref_table = $schema->get_table( $ref_table_name ) or throw("Can't find table '$ref_table_name'"); if ( my $constraint = $ref_table->primary_key ) { return [ $constraint->fields ]; } else { throw( 'No reference fields defined and cannot find primary key in ', "reference table '$ref_table_name'" ); } } } =head2 reference_table Get or set the table referred to by the constraint. my $reference_table = $constraint->reference_table('foo'); =cut has reference_table => ( is => 'rw', default => quote_sub(q{ '' }) ); =head2 table Get or set the constraint's table object. my $table = $field->table; =cut has table => ( is => 'rw', isa => schema_obj('Table'), weak_ref => 1 ); around table => \&ex2err; =head2 type Get or set the constraint's type. my $type = $constraint->type( PRIMARY_KEY ); =cut has type => ( is => 'rw', default => quote_sub(q{ '' }), coerce => quote_sub(q{ (my $t = $_[0]) =~ s/_/ /g; uc $t }), isa => enum([keys %VALID_CONSTRAINT_TYPE], { msg => "Invalid constraint type: %s", allow_false => 1, }), ); around type => \&ex2err; =head2 equals Determines if this constraint is the same as another my $isIdentical = $constraint1->equals( $constraint2 ); =cut around equals => sub { my $orig = shift; my $self = shift; my $other = shift; my $case_insensitive = shift; my $ignore_constraint_names = shift; return 0 unless $self->$orig($other); return 0 unless $self->type eq $other->type; unless ($ignore_constraint_names) { return 0 unless $case_insensitive ? uc($self->name) eq uc($other->name) : $self->name eq $other->name; } return 0 unless $self->deferrable eq $other->deferrable; #return 0 unless $self->is_valid eq $other->is_valid; return 0 unless $case_insensitive ? uc($self->table->name) eq uc($other->table->name) : $self->table->name eq $other->table->name; return 0 unless $self->expression eq $other->expression; # Check fields, regardless of order my %otherFields = (); # create a hash of the other fields foreach my $otherField ($other->fields) { $otherField = uc($otherField) if $case_insensitive; $otherFields{$otherField} = 1; } foreach my $selfField ($self->fields) { # check for self fields in hash $selfField = uc($selfField) if $case_insensitive; return 0 unless $otherFields{$selfField}; delete $otherFields{$selfField}; } # Check all other fields were accounted for return 0 unless keys %otherFields == 0; # Check reference fields, regardless of order my %otherRefFields = (); # create a hash of the other reference fields foreach my $otherRefField ($other->reference_fields) { $otherRefField = uc($otherRefField) if $case_insensitive; $otherRefFields{$otherRefField} = 1; } foreach my $selfRefField ($self->reference_fields) { # check for self reference fields in hash $selfRefField = uc($selfRefField) if $case_insensitive; return 0 unless $otherRefFields{$selfRefField}; delete $otherRefFields{$selfRefField}; } # Check all other reference fields were accounted for return 0 unless keys %otherRefFields == 0; return 0 unless $case_insensitive ? uc($self->reference_table) eq uc($other->reference_table) : $self->reference_table eq $other->reference_table; return 0 unless $self->match_type eq $other->match_type; return 0 unless $self->on_delete eq $other->on_delete; return 0 unless $self->on_update eq $other->on_update; return 0 unless $self->_compare_objects(scalar $self->options, scalar $other->options); return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra); return 1; }; # Must come after all 'has' declarations around new => \&ex2err; 1; =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11021/lib/SQL/Translator/Schema/Procedure.pm0000644000175000017500000001036112163313615023006 0ustar ilmariilmaripackage SQL::Translator::Schema::Procedure; =pod =head1 NAME SQL::Translator::Schema::Procedure - SQL::Translator procedure object =head1 SYNOPSIS use SQL::Translator::Schema::Procedure; my $procedure = SQL::Translator::Schema::Procedure->new( name => 'foo', sql => 'CREATE PROC foo AS SELECT * FROM bar', parameters => 'foo,bar', owner => 'nomar', comments => 'blah blah blah', schema => $schema, ); =head1 DESCRIPTION C is a class for dealing with stored procedures (and possibly other pieces of nameable SQL code?). =head1 METHODS =cut use Moo; use SQL::Translator::Utils qw(ex2err); use SQL::Translator::Role::ListAttr; use SQL::Translator::Types qw(schema_obj); use Sub::Quote qw(quote_sub); extends 'SQL::Translator::Schema::Object'; our $VERSION = '1.59'; =head2 new Object constructor. my $schema = SQL::Translator::Schema::Procedure->new; =cut =head2 parameters Gets and set the parameters of the stored procedure. $procedure->parameters('id'); $procedure->parameters('id', 'name'); $procedure->parameters( 'id, name' ); $procedure->parameters( [ 'id', 'name' ] ); $procedure->parameters( qw[ id name ] ); my @parameters = $procedure->parameters; =cut with ListAttr parameters => ( uniq => 1 ); =head2 name Get or set the procedure's name. $procedure->name('foo'); my $name = $procedure->name; =cut has name => ( is => 'rw', default => quote_sub(q{ '' }) ); =head2 sql Get or set the procedure's SQL. $procedure->sql('select * from foo'); my $sql = $procedure->sql; =cut has sql => ( is => 'rw', default => quote_sub(q{ '' }) ); =head2 order Get or set the order of the procedure. $procedure->order( 3 ); my $order = $procedure->order; =cut has order => ( is => 'rw' ); =head2 owner Get or set the owner of the procedure. $procedure->owner('nomar'); my $sql = $procedure->owner; =cut has owner => ( is => 'rw', default => quote_sub(q{ '' }) ); =head2 comments Get or set the comments on a procedure. $procedure->comments('foo'); $procedure->comments('bar'); print join( ', ', $procedure->comments ); # prints "foo, bar" =cut has comments => ( is => 'rw', coerce => quote_sub(q{ ref($_[0]) eq 'ARRAY' ? $_[0] : [$_[0]] }), default => quote_sub(q{ [] }), ); around comments => sub { my $orig = shift; my $self = shift; my @comments = ref $_[0] ? @{ $_[0] } : @_; for my $arg ( @comments ) { $arg = $arg->[0] if ref $arg; push @{ $self->$orig }, $arg if defined $arg && $arg; } return wantarray ? @{ $self->$orig } : join( "\n", @{ $self->$orig } ); }; =head2 schema Get or set the procedures's schema object. $procedure->schema( $schema ); my $schema = $procedure->schema; =cut has schema => ( is => 'rw', isa => schema_obj('Schema'), weak_ref => 1 ); around schema => \&ex2err; =head2 equals Determines if this procedure is the same as another my $isIdentical = $procedure1->equals( $procedure2 ); =cut around equals => sub { my $orig = shift; my $self = shift; my $other = shift; my $case_insensitive = shift; my $ignore_sql = shift; return 0 unless $self->$orig($other); return 0 unless $case_insensitive ? uc($self->name) eq uc($other->name) : $self->name eq $other->name; unless ($ignore_sql) { my $selfSql = $self->sql; my $otherSql = $other->sql; # Remove comments $selfSql =~ s/--.*$//mg; $otherSql =~ s/--.*$//mg; # Collapse whitespace to space to avoid whitespace comparison issues $selfSql =~ s/\s+/ /sg; $otherSql =~ s/\s+/ /sg; return 0 unless $selfSql eq $otherSql; } return 0 unless $self->_compare_objects(scalar $self->parameters, scalar $other->parameters); # return 0 unless $self->comments eq $other->comments; # return 0 unless $case_insensitive ? uc($self->owner) eq uc($other->owner) : $self->owner eq $other->owner; return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra); return 1; }; # Must come after all 'has' declarations around new => \&ex2err; 1; =pod =head1 AUTHORS Ken Youens-Clark Ekclark@cshl.orgE, Paul Harrington EPaul-Harrington@deshaw.comE. =cut SQL-Translator-0.11021/lib/SQL/Translator/Schema/Index.pm0000644000175000017500000001130712163313615022126 0ustar ilmariilmaripackage SQL::Translator::Schema::Index; =pod =head1 NAME SQL::Translator::Schema::Index - SQL::Translator index object =head1 SYNOPSIS use SQL::Translator::Schema::Index; my $index = SQL::Translator::Schema::Index->new( name => 'foo', fields => [ id ], type => 'unique', ); =head1 DESCRIPTION C is the index object. Primary and unique keys are table constraints, not indices. =head1 METHODS =cut use Moo; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(ex2err throw); use SQL::Translator::Role::ListAttr; use SQL::Translator::Types qw(schema_obj enum); use Sub::Quote qw(quote_sub); extends 'SQL::Translator::Schema::Object'; our $VERSION = '1.59'; my %VALID_INDEX_TYPE = ( UNIQUE => 1, NORMAL => 1, FULLTEXT => 1, # MySQL only (?) FULL_TEXT => 1, # MySQL only (?) SPATIAL => 1, # MySQL only (?) ); =head2 new Object constructor. my $schema = SQL::Translator::Schema::Index->new; =head2 fields Gets and set the fields the index is on. Accepts a string, list or arrayref; returns an array or array reference. Will unique the field names and keep them in order by the first occurrence of a field name. $index->fields('id'); $index->fields('id', 'name'); $index->fields( 'id, name' ); $index->fields( [ 'id', 'name' ] ); $index->fields( qw[ id name ] ); my @fields = $index->fields; =cut with ListAttr fields => ( uniq => 1 ); sub is_valid { =pod =head2 is_valid Determine whether the index is valid or not. my $ok = $index->is_valid; =cut my $self = shift; my $table = $self->table or return $self->error('No table'); my @fields = $self->fields or return $self->error('No fields'); for my $field ( @fields ) { return $self->error( "Field '$field' does not exist in table '", $table->name, "'" ) unless $table->get_field( $field ); } return 1; } =head2 name Get or set the index's name. my $name = $index->name('foo'); =cut has name => ( is => 'rw', coerce => quote_sub(q{ defined $_[0] ? $_[0] : '' }), default => quote_sub(q{ '' }), ); =head2 options Get or set the index's options (e.g., "using" or "where" for PG). Returns an array or array reference. my @options = $index->options; =cut with ListAttr options => (); =head2 table Get or set the index's table object. my $table = $index->table; =cut has table => ( is => 'rw', isa => schema_obj('Table'), weak_ref => 1 ); around table => \&ex2err; =head2 type Get or set the index's type. my $type = $index->type('unique'); Get or set the index's type. Currently there are only four acceptable types: UNIQUE, NORMAL, FULL_TEXT, and SPATIAL. The latter two might be MySQL-specific. While both lowercase and uppercase types are acceptable input, this method returns the type in uppercase. =cut has type => ( is => 'rw', coerce => quote_sub(q{ uc $_[0] }), default => quote_sub(q{ 'NORMAL' }), isa => enum([keys %VALID_INDEX_TYPE], { msg => "Invalid index type: %s", allow_false => 1, }), ); around type => \&ex2err; =head2 equals Determines if this index is the same as another my $isIdentical = $index1->equals( $index2 ); =cut around equals => sub { my $orig = shift; my $self = shift; my $other = shift; my $case_insensitive = shift; my $ignore_index_names = shift; return 0 unless $self->$orig($other); unless ($ignore_index_names) { unless ((!$self->name && ($other->name eq $other->fields->[0])) || (!$other->name && ($self->name eq $self->fields->[0]))) { return 0 unless $case_insensitive ? uc($self->name) eq uc($other->name) : $self->name eq $other->name; } } #return 0 unless $self->is_valid eq $other->is_valid; return 0 unless $self->type eq $other->type; # Check fields, regardless of order my %otherFields = (); # create a hash of the other fields foreach my $otherField ($other->fields) { $otherField = uc($otherField) if $case_insensitive; $otherFields{$otherField} = 1; } foreach my $selfField ($self->fields) { # check for self fields in hash $selfField = uc($selfField) if $case_insensitive; return 0 unless $otherFields{$selfField}; delete $otherFields{$selfField}; } # Check all other fields were accounted for return 0 unless keys %otherFields == 0; return 0 unless $self->_compare_objects(scalar $self->options, scalar $other->options); return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra); return 1; }; # Must come after all 'has' declarations around new => \&ex2err; 1; =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11021/lib/SQL/Translator/Schema/Field.pm0000644000175000017500000003170412372440725022112 0ustar ilmariilmaripackage SQL::Translator::Schema::Field; =pod =head1 NAME SQL::Translator::Schema::Field - SQL::Translator field object =head1 SYNOPSIS use SQL::Translator::Schema::Field; my $field = SQL::Translator::Schema::Field->new( name => 'foo', table => $table, ); =head1 DESCRIPTION C is the field object. =head1 METHODS =cut use Moo; use SQL::Translator::Schema::Constants; use SQL::Translator::Types qw(schema_obj); use SQL::Translator::Utils qw(parse_list_arg ex2err throw carp_ro); use Sub::Quote qw(quote_sub); use Scalar::Util (); extends 'SQL::Translator::Schema::Object'; our $VERSION = '1.59'; # Stringify to our name, being careful not to pass any args through so we don't # accidentally set it to undef. We also have to tweak bool so the object is # still true when it doesn't have a name (which shouldn't happen!). use overload '""' => sub { shift->name }, 'bool' => sub { $_[0]->name || $_[0] }, fallback => 1, ; use DBI qw(:sql_types); # Mapping from string to sql constant our %type_mapping = ( integer => SQL_INTEGER, int => SQL_INTEGER, tinyint => SQL_TINYINT, smallint => SQL_SMALLINT, bigint => SQL_BIGINT, double => SQL_DOUBLE, 'double precision' => SQL_DOUBLE, decimal => SQL_DECIMAL, dec => SQL_DECIMAL, numeric => SQL_NUMERIC, real => SQL_REAL, float => SQL_FLOAT, bit => SQL_BIT, date => SQL_DATE, datetime => SQL_DATETIME, timestamp => SQL_TIMESTAMP, time => SQL_TIME, char => SQL_CHAR, varchar => SQL_VARCHAR, binary => SQL_BINARY, varbinary => SQL_VARBINARY, tinyblob => SQL_BLOB, blob => SQL_BLOB, text => SQL_LONGVARCHAR ); has _numeric_sql_data_types => ( is => 'lazy' ); sub _build__numeric_sql_data_types { return { map { $_ => 1 } (SQL_INTEGER, SQL_TINYINT, SQL_SMALLINT, SQL_BIGINT, SQL_DOUBLE, SQL_NUMERIC, SQL_DECIMAL, SQL_FLOAT, SQL_REAL) }; } =head2 new Object constructor. my $field = SQL::Translator::Schema::Field->new( name => 'foo', table => $table, ); =head2 comments Get or set the comments on a field. May be called several times to set and it will accumulate the comments. Called in an array context, returns each comment individually; called in a scalar context, returns all the comments joined on newlines. $field->comments('foo'); $field->comments('bar'); print join( ', ', $field->comments ); # prints "foo, bar" =cut has comments => ( is => 'rw', coerce => quote_sub(q{ ref($_[0]) eq 'ARRAY' ? $_[0] : [$_[0]] }), default => quote_sub(q{ [] }), ); around comments => sub { my $orig = shift; my $self = shift; for my $arg ( @_ ) { $arg = $arg->[0] if ref $arg; push @{ $self->$orig }, $arg if $arg; } return wantarray ? @{ $self->$orig } : join( "\n", @{ $self->$orig } ); }; =head2 data_type Get or set the field's data type. my $data_type = $field->data_type('integer'); =cut has data_type => ( is => 'rw', default => quote_sub(q{ '' }) ); =head2 sql_data_type Constant from DBI package representing this data type. See L for more details. =cut has sql_data_type => ( is => 'rw', lazy => 1, builder => 1 ); sub _build_sql_data_type { $type_mapping{lc $_[0]->data_type} || SQL_UNKNOWN_TYPE; } =head2 default_value Get or set the field's default value. Will return undef if not defined and could return the empty string (it's a valid default value), so don't assume an error like other methods. my $default = $field->default_value('foo'); =cut has default_value => ( is => 'rw' ); =head2 foreign_key_reference Get or set the field's foreign key reference; my $constraint = $field->foreign_key_reference( $constraint ); =cut has foreign_key_reference => ( is => 'rw', predicate => '_has_foreign_key_reference', isa => schema_obj('Constraint'), weak_ref => 1, ); around foreign_key_reference => sub { my $orig = shift; my $self = shift; if ( my $arg = shift ) { return $self->error( 'Foreign key reference for ', $self->name, 'already defined' ) if $self->_has_foreign_key_reference; return ex2err($orig, $self, $arg); } $self->$orig; }; =head2 is_auto_increment Get or set the field's C attribute. my $is_auto = $field->is_auto_increment(1); =cut has is_auto_increment => ( is => 'rw', coerce => quote_sub(q{ $_[0] ? 1 : 0 }), builder => 1, lazy => 1, ); sub _build_is_auto_increment { my ( $self ) = @_; if ( my $table = $self->table ) { if ( my $schema = $table->schema ) { if ( $schema->database eq 'PostgreSQL' && $self->data_type eq 'serial' ) { return 1; } } } return 0; } =head2 is_foreign_key Returns whether or not the field is a foreign key. my $is_fk = $field->is_foreign_key; =cut has is_foreign_key => ( is => 'rw', coerce => quote_sub(q{ $_[0] ? 1 : 0 }), builder => 1, lazy => 1, ); sub _build_is_foreign_key { my ( $self ) = @_; if ( my $table = $self->table ) { for my $c ( $table->get_constraints ) { if ( $c->type eq FOREIGN_KEY ) { my %fields = map { $_, 1 } $c->fields; if ( $fields{ $self->name } ) { $self->foreign_key_reference( $c ); return 1; } } } } return 0; } =head2 is_nullable Get or set whether the field can be null. If not defined, then returns "1" (assumes the field can be null). The argument is evaluated by Perl for True or False, so the following are equivalent: $is_nullable = $field->is_nullable(0); $is_nullable = $field->is_nullable(''); $is_nullable = $field->is_nullable('0'); While this is technically a field constraint, it's probably easier to represent this as an attribute of the field. In order keep things consistent, any other constraint on the field (unique, primary, and foreign keys; checks) are represented as table constraints. =cut has is_nullable => ( is => 'rw', coerce => quote_sub(q{ $_[0] ? 1 : 0 }), default => quote_sub(q{ 1 }), ); around is_nullable => sub { my ($orig, $self, $arg) = @_; $self->$orig($self->is_primary_key ? 0 : defined $arg ? $arg : ()); }; =head2 is_primary_key Get or set the field's C attribute. Does not create a table constraint (should it?). my $is_pk = $field->is_primary_key(1); =cut has is_primary_key => ( is => 'rw', coerce => quote_sub(q{ $_[0] ? 1 : 0 }), lazy => 1, builder => 1, ); sub _build_is_primary_key { my ( $self ) = @_; if ( my $table = $self->table ) { if ( my $pk = $table->primary_key ) { my %fields = map { $_, 1 } $pk->fields; return $fields{ $self->name } || 0; } } return 0; } =head2 is_unique Determine whether the field has a UNIQUE constraint or not. my $is_unique = $field->is_unique; =cut has is_unique => ( is => 'lazy', init_arg => undef ); around is_unique => carp_ro('is_unique'); sub _build_is_unique { my ( $self ) = @_; if ( my $table = $self->table ) { for my $c ( $table->get_constraints ) { if ( $c->type eq UNIQUE ) { my %fields = map { $_, 1 } $c->fields; if ( $fields{ $self->name } ) { return 1; } } } } return 0; } sub is_valid { =pod =head2 is_valid Determine whether the field is valid or not. my $ok = $field->is_valid; =cut my $self = shift; return $self->error('No name') unless $self->name; return $self->error('No data type') unless $self->data_type; return $self->error('No table object') unless $self->table; return 1; } =head2 name Get or set the field's name. my $name = $field->name('foo'); The field object will also stringify to its name. my $setter_name = "set_$field"; Errors ("No field name") if you try to set a blank name. =cut has name => ( is => 'rw', isa => sub { throw( "No field name" ) unless $_[0] } ); around name => sub { my $orig = shift; my $self = shift; if ( my ($arg) = @_ ) { if ( my $schema = $self->table ) { return $self->error( qq[Can't use field name "$arg": field exists] ) if $schema->get_field( $arg ); } } return ex2err($orig, $self, @_); }; sub full_name { =head2 full_name Read only method to return the fields name with its table name pre-pended. e.g. "person.foo". =cut my $self = shift; return $self->table.".".$self->name; } =head2 order Get or set the field's order. my $order = $field->order(3); =cut has order => ( is => 'rw', default => quote_sub(q{ 0 }) ); around order => sub { my ( $orig, $self, $arg ) = @_; if ( defined $arg && $arg =~ /^\d+$/ ) { return $self->$orig($arg); } return $self->$orig; }; sub schema { =head2 schema Shortcut to get the fields schema ($field->table->schema) or undef if it doesn't have one. my $schema = $field->schema; =cut my $self = shift; if ( my $table = $self->table ) { return $table->schema || undef; } return undef; } =head2 size Get or set the field's size. Accepts a string, array or arrayref of numbers and returns a string. $field->size( 30 ); $field->size( [ 255 ] ); $size = $field->size( 10, 2 ); print $size; # prints "10,2" $size = $field->size( '10, 2' ); print $size; # prints "10,2" =cut has size => ( is => 'rw', default => quote_sub(q{ [0] }), coerce => sub { my @sizes = grep { defined && m/^\d+(?:\.\d+)?$/ } @{parse_list_arg($_[0])}; @sizes ? \@sizes : [0]; }, ); around size => sub { my $orig = shift; my $self = shift; my $numbers = parse_list_arg( @_ ); if ( @$numbers ) { my @new; for my $num ( @$numbers ) { if ( defined $num && $num =~ m/^\d+(?:\.\d+)?$/ ) { push @new, $num; } } $self->$orig(\@new) if @new; # only set if all OK } return wantarray ? @{ $self->$orig || [0] } : join( ',', @{ $self->$orig || [0] } ) ; }; =head2 table Get or set the field's table object. As the table object stringifies this can also be used to get the table name. my $table = $field->table; print "Table name: $table"; =cut has table => ( is => 'rw', isa => schema_obj('Table'), weak_ref => 1 ); around table => \&ex2err; =head2 parsed_field Returns the field exactly as the parser found it =cut has parsed_field => ( is => 'rw' ); around parsed_field => sub { my $orig = shift; my $self = shift; return $self->$orig(@_) || $self; }; =head2 equals Determines if this field is the same as another my $isIdentical = $field1->equals( $field2 ); =cut around equals => sub { my $orig = shift; my $self = shift; my $other = shift; my $case_insensitive = shift; return 0 unless $self->$orig($other); return 0 unless $case_insensitive ? uc($self->name) eq uc($other->name) : $self->name eq $other->name; # Comparing types: use sql_data_type if both are not 0. Else use string data_type if ($self->sql_data_type && $other->sql_data_type) { return 0 unless $self->sql_data_type == $other->sql_data_type } else { return 0 unless lc($self->data_type) eq lc($other->data_type) } return 0 unless $self->size eq $other->size; { my $lhs = $self->default_value; $lhs = \'NULL' unless defined $lhs; my $lhs_is_ref = ! ! ref $lhs; my $rhs = $other->default_value; $rhs = \'NULL' unless defined $rhs; my $rhs_is_ref = ! ! ref $rhs; # If only one is a ref, fail. -- rjbs, 2008-12-02 return 0 if $lhs_is_ref xor $rhs_is_ref; my $effective_lhs = $lhs_is_ref ? $$lhs : $lhs; my $effective_rhs = $rhs_is_ref ? $$rhs : $rhs; if ( $self->_is_numeric_data_type && Scalar::Util::looks_like_number($effective_lhs) && Scalar::Util::looks_like_number($effective_rhs) ) { return 0 if ($effective_lhs + 0) != ($effective_rhs + 0); } else { return 0 if $effective_lhs ne $effective_rhs; } } return 0 unless $self->is_nullable eq $other->is_nullable; # return 0 unless $self->is_unique eq $other->is_unique; return 0 unless $self->is_primary_key eq $other->is_primary_key; # return 0 unless $self->is_foreign_key eq $other->is_foreign_key; return 0 unless $self->is_auto_increment eq $other->is_auto_increment; # return 0 unless $self->comments eq $other->comments; return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra); return 1; }; # Must come after all 'has' declarations around new => \&ex2err; sub _is_numeric_data_type { my $self = shift; return $self->_numeric_sql_data_types->{ $self->sql_data_type }; } 1; =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11021/lib/SQL/Translator/Schema/Table.pm0000644000175000017500000006304112364467241022120 0ustar ilmariilmaripackage SQL::Translator::Schema::Table; =pod =head1 NAME SQL::Translator::Schema::Table - SQL::Translator table object =head1 SYNOPSIS use SQL::Translator::Schema::Table; my $table = SQL::Translator::Schema::Table->new( name => 'foo' ); =head1 DESCRIPTION C is the table object. =head1 METHODS =cut use Moo; use SQL::Translator::Utils qw(parse_list_arg ex2err throw carp_ro); use SQL::Translator::Types qw(schema_obj); use SQL::Translator::Role::ListAttr; use SQL::Translator::Schema::Constants; use SQL::Translator::Schema::Constraint; use SQL::Translator::Schema::Field; use SQL::Translator::Schema::Index; use Carp::Clan '^SQL::Translator'; use List::Util 'max'; use Sub::Quote qw(quote_sub); extends 'SQL::Translator::Schema::Object'; our $VERSION = '1.59'; # Stringify to our name, being careful not to pass any args through so we don't # accidentally set it to undef. We also have to tweak bool so the object is # still true when it doesn't have a name (which shouldn't happen!). use overload '""' => sub { shift->name }, 'bool' => sub { $_[0]->name || $_[0] }, fallback => 1, ; =pod =head2 new Object constructor. my $table = SQL::Translator::Schema::Table->new( schema => $schema, name => 'foo', ); =head2 add_constraint Add a constraint to the table. Returns the newly created C object. my $c1 = $table->add_constraint( name => 'pk', type => PRIMARY_KEY, fields => [ 'foo_id' ], ); my $c2 = SQL::Translator::Schema::Constraint->new( name => 'uniq' ); $c2 = $table->add_constraint( $constraint ); =cut has _constraints => ( is => 'ro', init_arg => undef, default => quote_sub(q{ +[] }), predicate => 1, lazy => 1, ); sub add_constraint { my $self = shift; my $constraint_class = 'SQL::Translator::Schema::Constraint'; my $constraint; if ( UNIVERSAL::isa( $_[0], $constraint_class ) ) { $constraint = shift; $constraint->table( $self ); } else { my %args = @_; $args{'table'} = $self; $constraint = $constraint_class->new( \%args ) or return $self->error( $constraint_class->error ); } # # If we're trying to add a PK when one is already defined, # then just add the fields to the existing definition. # my $ok = 1; my $pk = $self->primary_key; if ( $pk && $constraint->type eq PRIMARY_KEY ) { $self->primary_key( $constraint->fields ); $pk->name($constraint->name) if $constraint->name; my %extra = $constraint->extra; $pk->extra(%extra) if keys %extra; $constraint = $pk; $ok = 0; } elsif ( $constraint->type eq PRIMARY_KEY ) { for my $fname ( $constraint->fields ) { if ( my $f = $self->get_field( $fname ) ) { $f->is_primary_key( 1 ); } } } # # See if another constraint of the same type # covers the same fields. -- This doesn't work! ky # # elsif ( $constraint->type ne CHECK_C ) { # my @field_names = $constraint->fields; # for my $c ( # grep { $_->type eq $constraint->type } # $self->get_constraints # ) { # my %fields = map { $_, 1 } $c->fields; # for my $field_name ( @field_names ) { # if ( $fields{ $field_name } ) { # $constraint = $c; # $ok = 0; # last; # } # } # last unless $ok; # } # } if ( $ok ) { push @{ $self->_constraints }, $constraint; } return $constraint; } =head2 drop_constraint Remove a constraint from the table. Returns the constraint object if the index was found and removed, an error otherwise. The single parameter can be either an index name or an C object. $table->drop_constraint('myconstraint'); =cut sub drop_constraint { my $self = shift; my $constraint_class = 'SQL::Translator::Schema::Constraint'; my $constraint_name; if ( UNIVERSAL::isa( $_[0], $constraint_class ) ) { $constraint_name = shift->name; } else { $constraint_name = shift; } if ( ! ($self->_has_constraints && grep { $_->name eq $constraint_name } @ { $self->_constraints }) ) { return $self->error(qq[Can't drop constraint: "$constraint_name" doesn't exist]); } my @cs = @{ $self->_constraints }; my ($constraint_id) = grep { $cs[$_]->name eq $constraint_name } (0..$#cs); my $constraint = splice(@{$self->_constraints}, $constraint_id, 1); return $constraint; } =head2 add_index Add an index to the table. Returns the newly created C object. my $i1 = $table->add_index( name => 'name', fields => [ 'name' ], type => 'normal', ); my $i2 = SQL::Translator::Schema::Index->new( name => 'id' ); $i2 = $table->add_index( $index ); =cut has _indices => ( is => 'ro', init_arg => undef, default => quote_sub(q{ [] }), predicate => 1, lazy => 1, ); sub add_index { my $self = shift; my $index_class = 'SQL::Translator::Schema::Index'; my $index; if ( UNIVERSAL::isa( $_[0], $index_class ) ) { $index = shift; $index->table( $self ); } else { my %args = @_; $args{'table'} = $self; $index = $index_class->new( \%args ) or return $self->error( $index_class->error ); } foreach my $ex_index ($self->get_indices) { return if ($ex_index->equals($index)); } push @{ $self->_indices }, $index; return $index; } =head2 drop_index Remove an index from the table. Returns the index object if the index was found and removed, an error otherwise. The single parameter can be either an index name of an C object. $table->drop_index('myindex'); =cut sub drop_index { my $self = shift; my $index_class = 'SQL::Translator::Schema::Index'; my $index_name; if ( UNIVERSAL::isa( $_[0], $index_class ) ) { $index_name = shift->name; } else { $index_name = shift; } if ( ! ($self->_has_indices && grep { $_->name eq $index_name } @{ $self->_indices }) ) { return $self->error(qq[Can't drop index: "$index_name" doesn't exist]); } my @is = @{ $self->_indices }; my ($index_id) = grep { $is[$_]->name eq $index_name } (0..$#is); my $index = splice(@{$self->_indices}, $index_id, 1); return $index; } =head2 add_field Add an field to the table. Returns the newly created C object. The "name" parameter is required. If you try to create a field with the same name as an existing field, you will get an error and the field will not be created. my $f1 = $table->add_field( name => 'foo_id', data_type => 'integer', size => 11, ); my $f2 = SQL::Translator::Schema::Field->new( name => 'name', table => $table, ); $f2 = $table->add_field( $field2 ) or die $table->error; =cut has _fields => ( is => 'ro', init_arg => undef, default => quote_sub(q{ +{} }), predicate => 1, lazy => 1 ); sub add_field { my $self = shift; my $field_class = 'SQL::Translator::Schema::Field'; my $field; if ( UNIVERSAL::isa( $_[0], $field_class ) ) { $field = shift; $field->table( $self ); } else { my %args = @_; $args{'table'} = $self; $field = $field_class->new( \%args ) or return $self->error( $field_class->error ); } my $existing_order = { map { $_->order => $_->name } $self->get_fields }; # supplied order, possible unordered assembly if ( $field->order ) { if($existing_order->{$field->order}) { croak sprintf "Requested order '%d' for column '%s' conflicts with already existing column '%s'", $field->order, $field->name, $existing_order->{$field->order}, ; } } else { my $last_field_no = max(keys %$existing_order) || 0; if ( $last_field_no != scalar keys %$existing_order ) { croak sprintf "Table '%s' field order incomplete - unable to auto-determine order for newly added field", $self->name, ; } $field->order( $last_field_no + 1 ); } # We know we have a name as the Field->new above errors if none given. my $field_name = $field->name; if ( $self->get_field($field_name) ) { return $self->error(qq[Can't use field name "$field_name": field exists]); } else { $self->_fields->{ $field_name } = $field; } return $field; } =head2 drop_field Remove a field from the table. Returns the field object if the field was found and removed, an error otherwise. The single parameter can be either a field name or an C object. $table->drop_field('myfield'); =cut sub drop_field { my $self = shift; my $field_class = 'SQL::Translator::Schema::Field'; my $field_name; if ( UNIVERSAL::isa( $_[0], $field_class ) ) { $field_name = shift->name; } else { $field_name = shift; } my %args = @_; my $cascade = $args{'cascade'}; if ( ! ($self->_has_fields && exists $self->_fields->{ $field_name } ) ) { return $self->error(qq[Can't drop field: "$field_name" doesn't exists]); } my $field = delete $self->_fields->{ $field_name }; if ( $cascade ) { # Remove this field from all indices using it foreach my $i ($self->get_indices()) { my @fs = $i->fields(); @fs = grep { $_ ne $field->name } @fs; $i->fields(@fs); } # Remove this field from all constraints using it foreach my $c ($self->get_constraints()) { my @cs = $c->fields(); @cs = grep { $_ ne $field->name } @cs; $c->fields(@cs); } } return $field; } =head2 comments Get or set the comments on a table. May be called several times to set and it will accumulate the comments. Called in an array context, returns each comment individually; called in a scalar context, returns all the comments joined on newlines. $table->comments('foo'); $table->comments('bar'); print join( ', ', $table->comments ); # prints "foo, bar" =cut has comments => ( is => 'rw', coerce => quote_sub(q{ ref($_[0]) eq 'ARRAY' ? $_[0] : [$_[0]] }), default => quote_sub(q{ [] }), ); around comments => sub { my $orig = shift; my $self = shift; my @comments = ref $_[0] ? @{ $_[0] } : @_; for my $arg ( @comments ) { $arg = $arg->[0] if ref $arg; push @{ $self->$orig }, $arg if defined $arg && $arg; } @comments = @{$self->$orig}; return wantarray ? @comments : @comments ? join( "\n", @comments ) : undef; }; =head2 get_constraints Returns all the constraint objects as an array or array reference. my @constraints = $table->get_constraints; =cut sub get_constraints { my $self = shift; if ( $self->_has_constraints ) { return wantarray ? @{ $self->_constraints } : $self->_constraints; } else { $self->error('No constraints'); return; } } =head2 get_indices Returns all the index objects as an array or array reference. my @indices = $table->get_indices; =cut sub get_indices { my $self = shift; if ( $self->_has_indices ) { return wantarray ? @{ $self->_indices } : $self->_indices; } else { $self->error('No indices'); return; } } =head2 get_field Returns a field by the name provided. my $field = $table->get_field('foo'); =cut sub get_field { my $self = shift; my $field_name = shift or return $self->error('No field name'); my $case_insensitive = shift; return $self->error(qq[Field "$field_name" does not exist]) unless $self->_has_fields; if ( $case_insensitive ) { $field_name = uc($field_name); foreach my $field ( keys %{$self->_fields} ) { return $self->_fields->{$field} if $field_name eq uc($field); } return $self->error(qq[Field "$field_name" does not exist]); } return $self->error( qq[Field "$field_name" does not exist] ) unless exists $self->_fields->{ $field_name }; return $self->_fields->{ $field_name }; } =head2 get_fields Returns all the field objects as an array or array reference. my @fields = $table->get_fields; =cut sub get_fields { my $self = shift; my @fields = map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [ $_->order, $_ ] } values %{ $self->_has_fields ? $self->_fields : {} }; if ( @fields ) { return wantarray ? @fields : \@fields; } else { $self->error('No fields'); return; } } =head2 is_valid Determine whether the view is valid or not. my $ok = $view->is_valid; =cut sub is_valid { my $self = shift; return $self->error('No name') unless $self->name; return $self->error('No fields') unless $self->get_fields; for my $object ( $self->get_fields, $self->get_indices, $self->get_constraints ) { return $object->error unless $object->is_valid; } return 1; } =head2 is_trivial_link True if table has no data (non-key) fields and only uses single key joins. =cut has is_trivial_link => ( is => 'lazy', init_arg => undef ); around is_trivial_link => carp_ro('is_trivial_link'); sub _build_is_trivial_link { my $self = shift; return 0 if $self->is_data; my %fk = (); foreach my $field ( $self->get_fields ) { next unless $field->is_foreign_key; $fk{$field->foreign_key_reference->reference_table}++; } foreach my $referenced (keys %fk){ if($fk{$referenced} > 1){ return 0; } } return 1; } =head2 is_data Returns true if the table has some non-key fields. =cut has is_data => ( is => 'lazy', init_arg => undef ); around is_data => carp_ro('is_data'); sub _build_is_data { my $self = shift; foreach my $field ( $self->get_fields ) { if ( !$field->is_primary_key and !$field->is_foreign_key ) { return 1; } } return 0; } =head2 can_link Determine whether the table can link two arg tables via many-to-many. my $ok = $table->can_link($table1,$table2); =cut has _can_link => ( is => 'ro', init_arg => undef, default => quote_sub(q{ +{} }) ); sub can_link { my ( $self, $table1, $table2 ) = @_; return $self->_can_link->{ $table1->name }{ $table2->name } if defined $self->_can_link->{ $table1->name }{ $table2->name }; if ( $self->is_data == 1 ) { $self->_can_link->{ $table1->name }{ $table2->name } = [0]; $self->_can_link->{ $table2->name }{ $table1->name } = [0]; return $self->_can_link->{ $table1->name }{ $table2->name }; } my %fk = (); foreach my $field ( $self->get_fields ) { if ( $field->is_foreign_key ) { push @{ $fk{ $field->foreign_key_reference->reference_table } }, $field->foreign_key_reference; } } if ( !defined( $fk{ $table1->name } ) or !defined( $fk{ $table2->name } ) ) { $self->_can_link->{ $table1->name }{ $table2->name } = [0]; $self->_can_link->{ $table2->name }{ $table1->name } = [0]; return $self->_can_link->{ $table1->name }{ $table2->name }; } # trivial traversal, only one way to link the two tables if ( scalar( @{ $fk{ $table1->name } } == 1 ) and scalar( @{ $fk{ $table2->name } } == 1 ) ) { $self->_can_link->{ $table1->name }{ $table2->name } = [ 'one2one', $fk{ $table1->name }, $fk{ $table2->name } ]; $self->_can_link->{ $table1->name }{ $table2->name } = [ 'one2one', $fk{ $table2->name }, $fk{ $table1->name } ]; # non-trivial traversal. one way to link table2, # many ways to link table1 } elsif ( scalar( @{ $fk{ $table1->name } } > 1 ) and scalar( @{ $fk{ $table2->name } } == 1 ) ) { $self->_can_link->{ $table1->name }{ $table2->name } = [ 'many2one', $fk{ $table1->name }, $fk{ $table2->name } ]; $self->_can_link->{ $table2->name }{ $table1->name } = [ 'one2many', $fk{ $table2->name }, $fk{ $table1->name } ]; # non-trivial traversal. one way to link table1, # many ways to link table2 } elsif ( scalar( @{ $fk{ $table1->name } } == 1 ) and scalar( @{ $fk{ $table2->name } } > 1 ) ) { $self->_can_link->{ $table1->name }{ $table2->name } = [ 'one2many', $fk{ $table1->name }, $fk{ $table2->name } ]; $self->_can_link->{ $table2->name }{ $table1->name } = [ 'many2one', $fk{ $table2->name }, $fk{ $table1->name } ]; # non-trivial traversal. many ways to link table1 and table2 } elsif ( scalar( @{ $fk{ $table1->name } } > 1 ) and scalar( @{ $fk{ $table2->name } } > 1 ) ) { $self->_can_link->{ $table1->name }{ $table2->name } = [ 'many2many', $fk{ $table1->name }, $fk{ $table2->name } ]; $self->_can_link->{ $table2->name }{ $table1->name } = [ 'many2many', $fk{ $table2->name }, $fk{ $table1->name } ]; # one of the tables didn't export a key # to this table, no linking possible } else { $self->_can_link->{ $table1->name }{ $table2->name } = [0]; $self->_can_link->{ $table2->name }{ $table1->name } = [0]; } return $self->_can_link->{ $table1->name }{ $table2->name }; } =head2 name Get or set the table's name. Errors ("No table name") if you try to set a blank name. If provided an argument, checks the schema object for a table of that name and disallows the change if one exists (setting the error to "Can't use table name "%s": table exists"). my $table_name = $table->name('foo'); =cut has name => ( is => 'rw', isa => sub { throw("No table name") unless $_[0] }, ); around name => sub { my $orig = shift; my $self = shift; if ( my ($arg) = @_ ) { if ( my $schema = $self->schema ) { return $self->error( qq[Can't use table name "$arg": table exists] ) if $schema->get_table( $arg ); } } return ex2err($orig, $self, @_); }; =head2 schema Get or set the table's schema object. my $schema = $table->schema; =cut has schema => ( is => 'rw', isa => schema_obj('Schema'), weak_ref => 1 ); around schema => \&ex2err; sub primary_key { =pod =head2 primary_key Gets or sets the table's primary key(s). Takes one or more field names (as a string, list or array[ref]) as an argument. If the field names are present, it will create a new PK if none exists, or it will add to the fields of an existing PK (and will unique the field names). Returns the C object representing the primary key. These are equivalent: $table->primary_key('id'); $table->primary_key(['name']); $table->primary_key('id','name']); $table->primary_key(['id','name']); $table->primary_key('id,name'); $table->primary_key(qw[ id name ]); my $pk = $table->primary_key; =cut my $self = shift; my $fields = parse_list_arg( @_ ); my $constraint; if ( @$fields ) { for my $f ( @$fields ) { return $self->error(qq[Invalid field "$f"]) unless $self->get_field($f); } my $has_pk; for my $c ( $self->get_constraints ) { if ( $c->type eq PRIMARY_KEY ) { $has_pk = 1; $c->fields( @{ $c->fields }, @$fields ); $constraint = $c; } } unless ( $has_pk ) { $constraint = $self->add_constraint( type => PRIMARY_KEY, fields => $fields, ) or return; } } if ( $constraint ) { return $constraint; } else { for my $c ( $self->get_constraints ) { return $c if $c->type eq PRIMARY_KEY; } } return; } =head2 options Get or append to the table's options (e.g., table types for MySQL). Returns an array or array reference. my @options = $table->options; =cut with ListAttr options => ( append => 1 ); =head2 order Get or set the table's order. my $order = $table->order(3); =cut has order => ( is => 'rw', default => quote_sub(q{ 0 }) ); around order => sub { my ( $orig, $self, $arg ) = @_; if ( defined $arg && $arg =~ /^\d+$/ ) { return $self->$orig($arg); } return $self->$orig; }; =head2 field_names Read-only method to return a list or array ref of the field names. Returns undef or an empty list if the table has no fields set. Useful if you want to avoid the overload magic of the Field objects returned by the get_fields method. my @names = $constraint->field_names; =cut sub field_names { my $self = shift; my @fields = map { $_->name } $self->get_fields; if ( @fields ) { return wantarray ? @fields : \@fields; } else { $self->error('No fields'); return; } } sub equals { =pod =head2 equals Determines if this table is the same as another my $isIdentical = $table1->equals( $table2 ); =cut my $self = shift; my $other = shift; my $case_insensitive = shift; return 0 unless $self->SUPER::equals($other); return 0 unless $case_insensitive ? uc($self->name) eq uc($other->name) : $self->name eq $other->name; return 0 unless $self->_compare_objects(scalar $self->options, scalar $other->options); return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra); # Fields # Go through our fields my %checkedFields; foreach my $field ( $self->get_fields ) { my $otherField = $other->get_field($field->name, $case_insensitive); return 0 unless $field->equals($otherField, $case_insensitive); $checkedFields{$field->name} = 1; } # Go through the other table's fields foreach my $otherField ( $other->get_fields ) { next if $checkedFields{$otherField->name}; return 0; } # Constraints # Go through our constraints my %checkedConstraints; CONSTRAINT: foreach my $constraint ( $self->get_constraints ) { foreach my $otherConstraint ( $other->get_constraints ) { if ( $constraint->equals($otherConstraint, $case_insensitive) ) { $checkedConstraints{$otherConstraint} = 1; next CONSTRAINT; } } return 0; } # Go through the other table's constraints CONSTRAINT2: foreach my $otherConstraint ( $other->get_constraints ) { next if $checkedFields{$otherConstraint}; foreach my $constraint ( $self->get_constraints ) { if ( $otherConstraint->equals($constraint, $case_insensitive) ) { next CONSTRAINT2; } } return 0; } # Indices # Go through our indices my %checkedIndices; INDEX: foreach my $index ( $self->get_indices ) { foreach my $otherIndex ( $other->get_indices ) { if ( $index->equals($otherIndex, $case_insensitive) ) { $checkedIndices{$otherIndex} = 1; next INDEX; } } return 0; } # Go through the other table's indices INDEX2: foreach my $otherIndex ( $other->get_indices ) { next if $checkedIndices{$otherIndex}; foreach my $index ( $self->get_indices ) { if ( $otherIndex->equals($index, $case_insensitive) ) { next INDEX2; } } return 0; } return 1; } =head1 LOOKUP METHODS The following are a set of shortcut methods for getting commonly used lists of fields and constraints. They all return lists or array refs of Field or Constraint objects. =over 4 =item pkey_fields The primary key fields. =item fkey_fields All foreign key fields. =item nonpkey_fields All the fields except the primary key. =item data_fields All non key fields. =item unique_fields All fields with unique constraints. =item unique_constraints All this tables unique constraints. =item fkey_constraints All this tables foreign key constraints. (See primary_key method to get the primary key constraint) =back =cut sub pkey_fields { my $me = shift; my @fields = grep { $_->is_primary_key } $me->get_fields; return wantarray ? @fields : \@fields; } sub fkey_fields { my $me = shift; my @fields; push @fields, $_->fields foreach $me->fkey_constraints; return wantarray ? @fields : \@fields; } sub nonpkey_fields { my $me = shift; my @fields = grep { !$_->is_primary_key } $me->get_fields; return wantarray ? @fields : \@fields; } sub data_fields { my $me = shift; my @fields = grep { !$_->is_foreign_key and !$_->is_primary_key } $me->get_fields; return wantarray ? @fields : \@fields; } sub unique_fields { my $me = shift; my @fields; push @fields, $_->fields foreach $me->unique_constraints; return wantarray ? @fields : \@fields; } sub unique_constraints { my $me = shift; my @cons = grep { $_->type eq UNIQUE } $me->get_constraints; return wantarray ? @cons : \@cons; } sub fkey_constraints { my $me = shift; my @cons = grep { $_->type eq FOREIGN_KEY } $me->get_constraints; return wantarray ? @cons : \@cons; } # Must come after all 'has' declarations around new => \&ex2err; 1; =pod =head1 AUTHORS Ken Youens-Clark Ekclark@cpan.orgE, Allen Day Eallenday@ucla.eduE. =cut SQL-Translator-0.11021/lib/SQL/Translator/Schema/Constants.pm0000644000175000017500000000221412163313615023030 0ustar ilmariilmaripackage SQL::Translator::Schema::Constants; =head1 NAME SQL::Translator::Schema::Constants - constants module =head1 SYNOPSIS use SQL::Translator::Schema::Constants; $table->add_constraint( name => 'foo', type => PRIMARY_KEY, ); =head1 DESCRIPTION This module exports the following constants for Schema features; =over 4 =item CHECK_C =item FOREIGN_KEY =item FULL_TEXT =item NOT_NULL =item NORMAL =item NULL =item PRIMARY_KEY =item UNIQUE =back =cut use strict; use warnings; use base qw( Exporter ); require Exporter; our $VERSION = '1.59'; our @EXPORT = qw[ CHECK_C FOREIGN_KEY FULL_TEXT SPATIAL NOT_NULL NORMAL NULL PRIMARY_KEY UNIQUE ]; # # Because "CHECK" is a Perl keyword # use constant CHECK_C => 'CHECK'; use constant FOREIGN_KEY => 'FOREIGN KEY'; use constant FULL_TEXT => 'FULLTEXT'; use constant SPATIAL => 'SPATIAL'; use constant NOT_NULL => 'NOT NULL'; use constant NORMAL => 'NORMAL'; use constant NULL => 'NULL'; use constant PRIMARY_KEY => 'PRIMARY KEY'; use constant UNIQUE => 'UNIQUE'; 1; =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11021/lib/SQL/Translator/Schema/Trigger.pm0000644000175000017500000001737312163313615022473 0ustar ilmariilmaripackage SQL::Translator::Schema::Trigger; =pod =head1 NAME SQL::Translator::Schema::Trigger - SQL::Translator trigger object =head1 SYNOPSIS use SQL::Translator::Schema::Trigger; my $trigger = SQL::Translator::Schema::Trigger->new( name => 'foo', perform_action_when => 'before', # or after database_events => [qw/update insert/], # also update, update_on, delete fields => [], # if event is "update" on_table => 'foo', # table name action => '...', # text of trigger schema => $schema, # Schema object scope => 'row', # or statement ); =head1 DESCRIPTION C is the trigger object. =head1 METHODS =cut use Moo; use SQL::Translator::Utils qw(parse_list_arg ex2err throw); use SQL::Translator::Types qw(schema_obj enum); use List::MoreUtils qw(uniq); use Sub::Quote qw(quote_sub); extends 'SQL::Translator::Schema::Object'; our $VERSION = '1.59'; =head2 new Object constructor. my $schema = SQL::Translator::Schema::Trigger->new; =cut around BUILDARGS => sub { my ($orig, $self, @args) = @_; my $args = $self->$orig(@args); if (exists $args->{on_table}) { my $arg = delete $args->{on_table}; my $table = $args->{schema}->get_table($arg) or die "Table named $arg doesn't exist"; $args->{table} = $table; } if (exists $args->{database_event}) { $args->{database_events} = delete $args->{database_event}; } return $args; }; =head2 perform_action_when Gets or sets whether the event happens "before" or "after" the C. $trigger->perform_action_when('after'); =cut has perform_action_when => ( is => 'rw', coerce => quote_sub(q{ defined $_[0] ? lc $_[0] : $_[0] }), isa => enum([qw(before after)], { msg => "Invalid argument '%s' to perform_action_when", allow_undef => 1, }), ); around perform_action_when => \&ex2err; sub database_event { =pod =head2 database_event Obsolete please use database_events! =cut my $self = shift; return $self->database_events( @_ ); } =head2 database_events Gets or sets the events that triggers the trigger. my $ok = $trigger->database_events('insert'); =cut has database_events => ( is => 'rw', coerce => quote_sub(q{ [ map { lc } ref $_[0] eq 'ARRAY' ? @{$_[0]} : ($_[0]) ] }), isa => sub { my @args = @{$_[0]}; my %valid = map { $_, 1 } qw[ insert update update_on delete ]; my @invalid = grep { !defined $valid{ $_ } } @args; if ( @invalid ) { throw( sprintf("Invalid events '%s' in database_events", join(', ', @invalid) ) ); } }, ); around database_events => sub { my ($orig,$self) = (shift, shift); if (@_) { ex2err($orig, $self, ref $_[0] eq 'ARRAY' ? $_[0] : \@_) or return; } return wantarray ? @{ $self->$orig || [] } : $self->$orig; }; =head2 fields Gets and set which fields to monitor for C. $view->fields('id'); $view->fields('id', 'name'); $view->fields( 'id, name' ); $view->fields( [ 'id', 'name' ] ); $view->fields( qw[ id name ] ); my @fields = $view->fields; =cut has fields => ( is => 'rw', coerce => sub { my @fields = uniq @{parse_list_arg($_[0])}; @fields ? \@fields : undef; }, ); around fields => sub { my $orig = shift; my $self = shift; my $fields = parse_list_arg( @_ ); $self->$orig($fields) if @$fields; return wantarray ? @{ $self->$orig || [] } : $self->$orig; }; =head2 table Gets or set the table on which the trigger works, as a L object. $trigger->table($triggered_table); =cut has table => ( is => 'rw', isa => schema_obj('Table'), weak_ref => 1 ); around table => \&ex2err; sub on_table { =pod =head2 on_table Gets or set the table name on which the trigger works, as a string. $trigger->on_table('foo'); =cut my ($self, $arg) = @_; if ( @_ == 2 ) { my $table = $self->schema->get_table($arg); die "Table named $arg doesn't exist" if !$table; $self->table($table); } return $self->table->name; } =head2 action Gets or set the action of the trigger. $trigger->action( q[ BEGIN select ...; update ...; END ] ); =cut has action => ( is => 'rw', default => quote_sub(q{ '' }) ); sub is_valid { =pod =head2 is_valid Determine whether the trigger is valid or not. my $ok = $trigger->is_valid; =cut my $self = shift; for my $attr ( qw[ name perform_action_when database_events on_table action ] ) { return $self->error("Invalid: missing '$attr'") unless $self->$attr(); } return $self->error("Missing fields for UPDATE ON") if $self->database_event eq 'update_on' && !$self->fields; return 1; } =head2 name Get or set the trigger's name. my $name = $trigger->name('foo'); =cut has name => ( is => 'rw', default => quote_sub(q{ '' }) ); =head2 order Get or set the trigger's order. my $order = $trigger->order(3); =cut has order => ( is => 'rw', default => quote_sub(q{ 0 }) ); around order => sub { my ( $orig, $self, $arg ) = @_; if ( defined $arg && $arg =~ /^\d+$/ ) { return $self->$orig($arg); } return $self->$orig; }; =head2 scope Get or set the trigger's scope (row or statement). my $scope = $trigger->scope('statement'); =cut has scope => ( is => 'rw', isa => enum([qw(row statement)], { msg => "Invalid scope '%s'", icase => 1, allow_undef => 1, }), ); around scope => \&ex2err; =head2 schema Get or set the trigger's schema object. $trigger->schema( $schema ); my $schema = $trigger->schema; =cut has schema => (is => 'rw', isa => schema_obj('Schema'), weak_ref => 1 ); around schema => \&ex2err; sub compare_arrays { =pod =head2 compare_arrays Compare two arrays. =cut my ($first, $second) = @_; no warnings; # silence spurious -w undef complaints return 0 unless (ref $first eq 'ARRAY' and ref $second eq 'ARRAY' ) ; return 0 unless @$first == @$second; my @first = sort @$first; my @second = sort @$second; for (my $i = 0; $i < scalar @first; $i++) { return 0 if @first[$i] ne @second[$i]; } return 1; } =head2 equals Determines if this trigger is the same as another my $is_identical = $trigger1->equals( $trigger2 ); =cut around equals => sub { my $orig = shift; my $self = shift; my $other = shift; my $case_insensitive = shift; return 0 unless $self->$orig($other); my %names; for my $name ( $self->name, $other->name ) { $name = lc $name if $case_insensitive; $names{ $name }++; } if ( keys %names > 1 ) { return $self->error('Names not equal'); } if ( !$self->perform_action_when eq $other->perform_action_when ) { return $self->error('perform_action_when differs'); } if ( !compare_arrays( [$self->database_events], [$other->database_events] ) ) { return $self->error('database_events differ'); } if ( $self->on_table ne $other->on_table ) { return $self->error('on_table differs'); } if ( $self->action ne $other->action ) { return $self->error('action differs'); } if ( !$self->_compare_objects( scalar $self->extra, scalar $other->extra ) ) { return $self->error('extras differ'); } return 1; }; # Must come after all 'has' declarations around new => \&ex2err; 1; =pod =head1 AUTHORS Anonymous, Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11021/lib/SQL/Translator/Schema/View.pm0000644000175000017500000001041112364436117021772 0ustar ilmariilmaripackage SQL::Translator::Schema::View; =pod =head1 NAME SQL::Translator::Schema::View - SQL::Translator view object =head1 SYNOPSIS use SQL::Translator::Schema::View; my $view = SQL::Translator::Schema::View->new( name => 'foo', # name, required sql => 'select id, name from foo', # SQL for view fields => 'id, name', # field names in view ); =head1 DESCRIPTION C is the view object. =head1 METHODS =cut use Moo; use SQL::Translator::Utils qw(ex2err); use SQL::Translator::Types qw(schema_obj); use SQL::Translator::Role::ListAttr; use Sub::Quote qw(quote_sub); extends 'SQL::Translator::Schema::Object'; our $VERSION = '1.59'; =head2 new Object constructor. my $view = SQL::Translator::Schema::View->new; =head2 fields Gets and set the fields the constraint is on. Accepts a string, list or arrayref; returns an array or array reference. Will unique the field names and keep them in order by the first occurrence of a field name. $view->fields('id'); $view->fields('id', 'name'); $view->fields( 'id, name' ); $view->fields( [ 'id', 'name' ] ); $view->fields( qw[ id name ] ); my @fields = $view->fields; =cut with ListAttr fields => ( uniq => 1 ); =head2 tables Gets and set the tables the SELECT mentions. Accepts a string, list or arrayref; returns an array or array reference. Will unique the table names and keep them in order by the first occurrence of a field name. $view->tables('foo'); $view->tables('foo', 'bar'); $view->tables( 'foo, bar' ); $view->tables( [ 'foo', 'bar' ] ); $view->tables( qw[ foo bar ] ); my @tables = $view->tables; =cut with ListAttr tables => ( uniq => 1 ); =head2 options Gets or appends a list of options on the view. $view->options('ALGORITHM=UNDEFINED'); my @options = $view->options; =cut with ListAttr options => ( uniq => 1, append => 1 ); sub is_valid { =pod =head2 is_valid Determine whether the view is valid or not. my $ok = $view->is_valid; =cut my $self = shift; return $self->error('No name') unless $self->name; return $self->error('No sql') unless $self->sql; return 1; } =head2 name Get or set the view's name. my $name = $view->name('foo'); =cut has name => ( is => 'rw', default => quote_sub(q{ '' }) ); =head2 order Get or set the view's order. my $order = $view->order(3); =cut has order => ( is => 'rw', default => quote_sub(q{ 0 }) ); around order => sub { my ( $orig, $self, $arg ) = @_; if ( defined $arg && $arg =~ /^\d+$/ ) { return $self->$orig($arg); } return $self->$orig; }; =head2 sql Get or set the view's SQL. my $sql = $view->sql('select * from foo'); =cut has sql => ( is => 'rw', default => quote_sub(q{ '' }) ); =head2 schema Get or set the view's schema object. $view->schema( $schema ); my $schema = $view->schema; =cut has schema => ( is => 'rw', isa => schema_obj('Schema'), weak_ref => 1 ); around schema => \&ex2err; =head2 equals Determines if this view is the same as another my $isIdentical = $view1->equals( $view2 ); =cut around equals => sub { my $orig = shift; my $self = shift; my $other = shift; my $case_insensitive = shift; my $ignore_sql = shift; return 0 unless $self->$orig($other); return 0 unless $case_insensitive ? uc($self->name) eq uc($other->name) : $self->name eq $other->name; #return 0 unless $self->is_valid eq $other->is_valid; unless ($ignore_sql) { my $selfSql = $self->sql; my $otherSql = $other->sql; # Remove comments $selfSql =~ s/--.*$//mg; $otherSql =~ s/--.*$//mg; # Collapse whitespace to space to avoid whitespace comparison issues $selfSql =~ s/\s+/ /sg; $otherSql =~ s/\s+/ /sg; return 0 unless $selfSql eq $otherSql; } my $selfFields = join(":", $self->fields); my $otherFields = join(":", $other->fields); return 0 unless $case_insensitive ? uc($selfFields) eq uc($otherFields) : $selfFields eq $otherFields; return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra); return 1; }; # Must come after all 'has' declarations around new => \&ex2err; 1; =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11021/lib/SQL/Translator/Schema/Object.pm0000644000175000017500000000202612163313615022263 0ustar ilmariilmaripackage SQL::Translator::Schema::Object; =head1 NAME SQL::Translator::Schema::Object - Base class for SQL::Translator schema objects =head1 SYNOPSIS package SQL::Translator::Schema::Foo; use Moo; extends 'SQL::Translator::Schema::Object'; =head1 DESCRIPTION Base class for Schema objects. A Moo class consuming the following roles. =over =item L Provides C<< $obj->error >>, similar to L. =item L Removes undefined constructor arguments, for backwards compatibility. =item L Provides an C attribute storing a hashref of arbitrary data. =item L Provides an C<< $obj->equals($other) >> method for testing object equality. =back =cut use Moo 1.000003; # screw you PAUSE our $VERSION = '1.59'; with qw( SQL::Translator::Role::Error SQL::Translator::Role::BuildArgs SQL::Translator::Schema::Role::Extra SQL::Translator::Schema::Role::Compare ); 1; SQL-Translator-0.11021/lib/SQL/Translator/Generator/0000755000175000017500000000000012462421250021242 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Generator/Role/0000755000175000017500000000000012462421250022143 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Generator/Role/Quote.pm0000644000175000017500000000265212421750412023603 0ustar ilmariilmaripackage 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-0.11021/lib/SQL/Translator/Generator/Role/DDL.pm0000644000175000017500000000517312421750412023112 0ustar ilmariilmaripackage 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-0.11021/lib/SQL/Translator/Generator/DDL/0000755000175000017500000000000012462421250021645 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Generator/DDL/SQLServer.pm0000644000175000017500000001457312421750467024055 0ustar ilmariilmaripackage 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-0.11021/lib/SQL/Translator/Generator/DDL/MySQL.pm0000644000175000017500000000054712421750412023156 0ustar ilmariilmaripackage 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-0.11021/lib/SQL/Translator/Generator/DDL/SQLite.pm0000644000175000017500000000433112163313615023350 0ustar ilmariilmaripackage 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 { 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_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-0.11021/lib/SQL/Translator/Generator/DDL/PostgreSQL.pm0000644000175000017500000000132412421750412024206 0ustar ilmariilmaripackage 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-0.11021/lib/SQL/Translator/Diff.pm0000644000175000017500000004236412411003422020522 0ustar ilmariilmaripackage SQL::Translator::Diff; ## SQLT schema diffing code use strict; use warnings; use Data::Dumper; use Carp::Clan qw/^SQL::Translator/; use SQL::Translator::Schema::Constants; use Sub::Quote qw(quote_sub); use Moo; has ignore_index_names => ( is => 'rw', ); has ignore_constraint_names => ( is => 'rw', ); has ignore_view_sql => ( is => 'rw', ); has ignore_proc_sql => ( is => 'rw', ); has output_db => ( is => 'rw', ); has source_schema => ( is => 'rw', ); has target_schema => ( is => 'rw', ); has case_insensitive => ( is => 'rw', ); has no_batch_alters => ( is => 'rw', ); has ignore_missing_methods => ( is => 'rw', ); has producer_args => ( is => 'rw', lazy => 1, default => quote_sub '{}', ); has tables_to_drop => ( is => 'rw', lazy => 1, default => quote_sub '[]', ); has tables_to_create => ( is => 'rw', lazy => 1, default => quote_sub '[]', ); has table_diff_hash => ( is => 'rw', lazy => 1, default => quote_sub '{}', ); my @diff_arrays = qw/ tables_to_drop tables_to_create /; my @diff_hash_keys = qw/ constraints_to_create constraints_to_drop indexes_to_create indexes_to_drop fields_to_create fields_to_alter fields_to_rename fields_to_drop table_options table_renamed_from /; sub schema_diff { # use Data::Dumper; ## we are getting instructions on how to turn the source into the target ## source == original, target == new (hmm, if I need to comment this, should I rename the vars again ??) ## _schema isa SQL::Translator::Schema ## _db is the name of the producer/db it came out of/into ## results are formatted to the source preferences my ($source_schema, $source_db, $target_schema, $output_db, $options) = @_; $options ||= {}; my $obj = SQL::Translator::Diff->new( { %$options, source_schema => $source_schema, target_schema => $target_schema, output_db => $output_db } ); $obj->compute_differences->produce_diff_sql; } sub BUILD { my ($self, $args) = @_; if ($args->{producer_options}) { carp 'producer_options is deprecated. Please use producer_args'; $self->producer_args({ %{$args->{producer_options}}, %{$self->producer_args} }); } if (! $self->output_db) { $self->output_db($args->{source_db}) } } sub compute_differences { my ($self) = @_; my $target_schema = $self->target_schema; my $source_schema = $self->source_schema; my $producer_class = "SQL::Translator::Producer::@{[$self->output_db]}"; eval "require $producer_class"; die $@ if $@; if (my $preprocess = $producer_class->can('preprocess_schema')) { $preprocess->($source_schema); $preprocess->($target_schema); } my %src_tables_checked = (); my @tar_tables = sort { $a->name cmp $b->name } $target_schema->get_tables; ## do original/source tables exist in target? for my $tar_table ( @tar_tables ) { my $tar_table_name = $tar_table->name; my $src_table; $self->table_diff_hash->{$tar_table_name} = { map {$_ => [] } @diff_hash_keys }; if (my $old_name = $tar_table->extra('renamed_from')) { $src_table = $source_schema->get_table( $old_name, $self->case_insensitive ); if ($src_table) { $self->table_diff_hash->{$tar_table_name}{table_renamed_from} = [ [$src_table, $tar_table] ]; } else { delete $tar_table->extra->{renamed_from}; carp qq#Renamed table can't find old table "$old_name" for renamed table\n#; } } else { $src_table = $source_schema->get_table( $tar_table_name, $self->case_insensitive ); } unless ( $src_table ) { ## table is new ## add table(s) later. push @{$self->tables_to_create}, $tar_table; next; } my $src_table_name = $src_table->name; $src_table_name = lc $src_table_name if $self->case_insensitive; $src_tables_checked{$src_table_name} = 1; $self->diff_table_options($src_table, $tar_table); ## Compare fields, their types, defaults, sizes etc etc $self->diff_table_fields($src_table, $tar_table); $self->diff_table_indexes($src_table, $tar_table); $self->diff_table_constraints($src_table, $tar_table); } # end of target_schema->get_tables loop for my $src_table ( $source_schema->get_tables ) { my $src_table_name = $src_table->name; $src_table_name = lc $src_table_name if $self->case_insensitive; push @{ $self->tables_to_drop}, $src_table unless $src_tables_checked{$src_table_name}; } return $self; } sub produce_diff_sql { my ($self) = @_; my $target_schema = $self->target_schema; my $source_schema = $self->source_schema; my $tar_name = $target_schema->name; my $src_name = $source_schema->name; my $producer_class = "SQL::Translator::Producer::@{[$self->output_db]}"; eval "require $producer_class"; die $@ if $@; # Map of name we store under => producer method name my %func_map = ( constraints_to_create => 'alter_create_constraint', constraints_to_drop => 'alter_drop_constraint', indexes_to_create => 'alter_create_index', indexes_to_drop => 'alter_drop_index', fields_to_create => 'add_field', fields_to_alter => 'alter_field', fields_to_rename => 'rename_field', fields_to_drop => 'drop_field', table_options => 'alter_table', table_renamed_from => 'rename_table', ); my @diffs; if (!$self->no_batch_alters && (my $batch_alter = $producer_class->can('batch_alter_table')) ) { # Good - Producer supports batch altering of tables. foreach my $table ( sort keys %{$self->table_diff_hash} ) { my $tar_table = $target_schema->get_table($table) || $source_schema->get_table($table); push @diffs, $batch_alter->($tar_table, { map { $func_map{$_} => $self->table_diff_hash->{$table}{$_} } keys %func_map }, $self->producer_args ); } } else { # If we have any table renames we need to do those first; my %flattened_diffs; foreach my $table ( sort keys %{$self->table_diff_hash} ) { my $table_diff = $self->table_diff_hash->{$table}; for (@diff_hash_keys) { push( @{ $flattened_diffs{ $func_map{$_} } ||= [] }, @{ $table_diff->{$_} } ); } } push @diffs, map( { if (@{ $flattened_diffs{$_} || [] }) { my $meth = $producer_class->can($_); $meth ? map { map { $_ ? "$_" : () } $meth->( (ref $_ eq 'ARRAY' ? @$_ : $_), $self->producer_args ); } @{ $flattened_diffs{$_} } : $self->ignore_missing_methods ? "-- $producer_class cant $_" : die "$producer_class cant $_"; } else { () } } 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/), } if (my @tables = @{ $self->tables_to_create } ) { my $translator = SQL::Translator->new( producer_type => $self->output_db, add_drop_table => 0, no_comments => 1, # TODO: sort out options %{ $self->producer_args } ); $translator->producer_args->{no_transaction} = 1; my $schema = $translator->schema; $schema->add_table($_) for @tables; unshift @diffs, # Remove begin/commit here, since we wrap everything in one. grep { $_ !~ /^(?:COMMIT|START(?: TRANSACTION)?|BEGIN(?: TRANSACTION)?)/ } $producer_class->can('produce')->($translator); } if (my @tables_to_drop = @{ $self->{tables_to_drop} || []} ) { my $meth = $producer_class->can('drop_table'); push @diffs, $meth ? ( map { $meth->($_, $self->producer_args) } @tables_to_drop) : $self->ignore_missing_methods ? "-- $producer_class cant drop_table" : die "$producer_class cant drop_table"; } if (@diffs) { unshift @diffs, "BEGIN"; push @diffs, "\nCOMMIT"; } else { @diffs = ("-- No differences found"); } if ( @diffs ) { if ( $self->output_db !~ /^(?:MySQL|SQLite|PostgreSQL)$/ ) { unshift(@diffs, "-- Output database @{[$self->output_db]} is untested/unsupported!!!"); } my @return = map { $_ ? ( $_ =~ /;\s*\z/xms ? $_ : "$_;\n\n" ) : "\n" } ("-- Convert schema '$src_name' to '$tar_name':", @diffs); return wantarray ? @return : join('', @return); } return undef; } sub diff_table_indexes { my ($self, $src_table, $tar_table) = @_; my (%checked_indices); INDEX_CREATE: for my $i_tar ( $tar_table->get_indices ) { for my $i_src ( $src_table->get_indices ) { if ( $i_tar->equals($i_src, $self->case_insensitive, $self->ignore_index_names) ) { $checked_indices{$i_src} = 1; next INDEX_CREATE; } } push @{$self->table_diff_hash->{$tar_table}{indexes_to_create}}, $i_tar; } INDEX_DROP: for my $i_src ( $src_table->get_indices ) { next if !$self->ignore_index_names && $checked_indices{$i_src}; for my $i_tar ( $tar_table->get_indices ) { next INDEX_DROP if $i_src->equals($i_tar, $self->case_insensitive, $self->ignore_index_names); } push @{$self->table_diff_hash->{$tar_table}{indexes_to_drop}}, $i_src; } } sub diff_table_constraints { my ($self, $src_table, $tar_table) = @_; my(%checked_constraints); CONSTRAINT_CREATE: for my $c_tar ( $tar_table->get_constraints ) { for my $c_src ( $src_table->get_constraints ) { # This is a bit of a hack - needed for renaming tables to work local $c_src->{table} = $tar_table; if ( $c_tar->equals($c_src, $self->case_insensitive, $self->ignore_constraint_names) ) { $checked_constraints{$c_src} = 1; next CONSTRAINT_CREATE; } } push @{ $self->table_diff_hash->{$tar_table}{constraints_to_create} }, $c_tar; } CONSTRAINT_DROP: for my $c_src ( $src_table->get_constraints ) { # This is a bit of a hack - needed for renaming tables to work local $c_src->{table} = $tar_table; next if !$self->ignore_constraint_names && $checked_constraints{$c_src}; for my $c_tar ( $tar_table->get_constraints ) { next CONSTRAINT_DROP if $c_src->equals($c_tar, $self->case_insensitive, $self->ignore_constraint_names); } push @{ $self->table_diff_hash->{$tar_table}{constraints_to_drop} }, $c_src; } } sub diff_table_fields { my ($self, $src_table, $tar_table) = @_; # List of ones we've renamed from so we don't drop them my %renamed_source_fields; for my $tar_table_field ( $tar_table->get_fields ) { my $f_tar_name = $tar_table_field->name; if (my $old_name = $tar_table_field->extra->{renamed_from}) { my $src_table_field = $src_table->get_field( $old_name, $self->case_insensitive ); unless ($src_table_field) { carp qq#Renamed column can't find old column "@{[$src_table->name]}.$old_name" for renamed column\n#; delete $tar_table_field->extra->{renamed_from}; } else { push @{$self->table_diff_hash->{$tar_table}{fields_to_rename} }, [ $src_table_field, $tar_table_field ]; $renamed_source_fields{$old_name} = 1; next; } } my $src_table_field = $src_table->get_field( $f_tar_name, $self->case_insensitive ); unless ( $src_table_field ) { push @{$self->table_diff_hash->{$tar_table}{fields_to_create}}, $tar_table_field; next; } # field exists, something changed. This is a bit complex. Parsers can # normalize types, but only some of them do, so compare the normalized and # parsed types for each field to each other if ( !$tar_table_field->equals($src_table_field, $self->case_insensitive) && !$tar_table_field->equals($src_table_field->parsed_field, $self->case_insensitive) && !$tar_table_field->parsed_field->equals($src_table_field, $self->case_insensitive) && !$tar_table_field->parsed_field->equals($src_table_field->parsed_field, $self->case_insensitive) ) { # Some producers might need src field to diff against push @{$self->table_diff_hash->{$tar_table}{fields_to_alter}}, [ $src_table_field, $tar_table_field ]; next; } } # Now check to see if any fields from src_table need to be dropped for my $src_table_field ( $src_table->get_fields ) { my $f_src_name = $src_table_field->name; next if $renamed_source_fields{$f_src_name}; my $tar_table_field = $tar_table->get_field( $f_src_name, $self->case_insensitive ); unless ( $tar_table_field ) { push @{$self->table_diff_hash->{$tar_table}{fields_to_drop}}, $src_table_field; next; } } } sub diff_table_options { my ($self, $src_table, $tar_table) = @_; my $cmp = sub { my ($a_name, undef, $b_name, undef) = ( %$a, %$b ); $a_name cmp $b_name; }; # Need to sort the options so we don't get spurious diffs. my (@src_opts, @tar_opts); @src_opts = sort $cmp $src_table->options; @tar_opts = sort $cmp $tar_table->options; # If there's a difference, just re-set all the options push @{ $self->table_diff_hash->{$tar_table}{table_options} }, $tar_table unless $src_table->_compare_objects( \@src_opts, \@tar_opts ); } # support producer_options as an alias for producer_args for legacy code. sub producer_options { my $self = shift; return $self->producer_args( @_ ); } 1; __END__ =head1 NAME SQL::Translator::Diff - determine differences between two schemas =head1 DESCRIPTION Takes two input SQL::Translator::Schemas (or SQL files) and produces ALTER statements to make them the same =head1 SNYOPSIS Simplest usage: use SQL::Translator::Diff; my $sql = SQL::Translator::Diff::schema_diff($source_schema, 'MySQL', $target_schema, 'MySQL', $options_hash) OO usage: use SQL::Translator::Diff; my $diff = SQL::Translator::Diff->new({ output_db => 'MySQL', source_schema => $source_schema, target_schema => $target_schema, %$options_hash, })->compute_differences->produce_diff_sql; =head1 OPTIONS =over =item B Match indexes based on types and fields, ignoring name. =item B Match constrains based on types, fields and tables, ignoring name. =item B Which producer to use to produce the output. =item B Ignore case of table, field, index and constraint names when comparing =item B Produce each alter as a distinct C statement even if the producer supports the ability to do all alters for a table as one statement. =item B If the diff would need a method that is missing from the producer, just emit a comment showing the method is missing, rather than dieing with an error =item B Hash of extra arguments passed to L and the below L. =back =head1 PRODUCER FUNCTIONS The following producer functions should be implemented for completeness. If any of them are needed for a given diff, but not found, an error will be thrown. =over =item * C =item * C =item * C =item * C =item * C =item * C =item * C =item * C =item * C =item * C =item * C (optional) =item * C (optional) If the producer supports C, it will be called with the table to alter and a hash, the keys of which will be the method names listed above; values will be arrays of fields or constraints to operate on. In the case of the field functions that take two arguments this will appear as an array reference. I.e. the hash might look something like the following: { alter_create_constraint => [ $constraint1, $constraint2 ], add_field => [ $field ], alter_field => [ [$old_field, $new_field] ] } =item * C (optional) C is called by the Diff code to allow the producer to normalize any data it needs to first. For example, the MySQL producer uses this method to ensure that FK constraint names are unique. Basicaly any changes that need to be made to produce the SQL file for the schema should be done here, so that a diff between a parsed SQL file and (say) a parsed DBIx::Class::Schema object will be sane. (As an aside, DBIx::Class, for instance, uses the presence of a C function on the producer to know that it can diff between the previous SQL file and its own internal representation. Without this method on th producer it will diff the two SQL files which is slower, but known to work better on old-style producers.) =back =head1 AUTHOR Original Author(s) unknown. Refactor/re-write and more comprehensive tests by Ash Berlin C<< ash@cpan.org >>. Redevelopment sponsored by Takkle Inc. =cut SQL-Translator-0.11021/lib/SQL/Translator/Types.pm0000644000175000017500000000463212221056401020756 0ustar ilmariilmaripackage SQL::Translator::Types; =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 strictures 1; 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-0.11021/lib/SQL/Translator/Parser/0000755000175000017500000000000012462421250020550 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Parser/SQLServer.pm0000644000175000017500000003737712421750412022755 0ustar ilmariilmaripackage 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.59'; 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[2]) =~ s/''/'/g } DQSTRING : '"' /(?:[^"]|"")+/ '"' { ($return = $item[2]) =~ s/""/"/g } BQSTRING : '[' /(?:[^]]|]])+/ ']' { ($return = $item[2]) =~ 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-0.11021/lib/SQL/Translator/Parser/Storable.pm0000644000175000017500000000204412163313615022664 0ustar ilmariilmaripackage 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.59'; 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-0.11021/lib/SQL/Translator/Parser/MySQL.pm0000644000175000017500000010064312421750412022057 0ustar ilmariilmaripackage 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.59'; 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; } field_comment2 : /comment/i SQSTRING { $return = $item[2] } blank : /\s*/ field : field_comment(s?) field_name data_type field_qualifier(s?) field_comment2(?) 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] }, @{ $item[5] }, @{ $item[8] } ); $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, } } 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]; } 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 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[2]) =~ s/(\\[\\`]|``)/substr($1,1)/ge } DQSTRING: DOUBLE_QUOTE /(?:[^\\"]|""|\\.)*/ DOUBLE_QUOTE { ($return = $item[2]) =~ s/(\\[\\"]|"")/substr($1,1)/ge } SQSTRING: SINGLE_QUOTE /(?:[^\\']|''|\\.)*/ SINGLE_QUOTE { ($return = $item[2]) =~ 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'}, 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-0.11021/lib/SQL/Translator/Parser/DBI/0000755000175000017500000000000012462421250021146 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Parser/DBI/SQLServer.pm0000644000175000017500000002364212234462467023355 0ustar ilmariilmaripackage 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.59'; $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-0.11021/lib/SQL/Translator/Parser/DBI/MySQL.pm0000644000175000017500000000326412421750412022456 0ustar ilmariilmaripackage 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.59'; $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-0.11021/lib/SQL/Translator/Parser/DBI/Sybase.pm0000644000175000017500000002105112234462467022745 0ustar ilmariilmaripackage 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.59'; $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-0.11021/lib/SQL/Translator/Parser/DBI/Oracle.pm0000644000175000017500000000733512163313615022724 0ustar ilmariilmaripackage 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.59'; 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-0.11021/lib/SQL/Translator/Parser/DBI/SQLite.pm0000644000175000017500000000262212163313615022652 0ustar ilmariilmaripackage 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.59'; $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-0.11021/lib/SQL/Translator/Parser/DBI/DB2.pm0000644000175000017500000001666712163313615022076 0ustar ilmariilmaripackage 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.59'; $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-0.11021/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm0000644000175000017500000001562712453030644023525 0ustar ilmariilmaripackage 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. =cut use strict; use warnings; use DBI; use Data::Dumper; use SQL::Translator::Schema::Constants; our ( $DEBUG, @EXPORT_OK ); our $VERSION = '1.59'; $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 $column_select = $dbh->prepare( "SELECT a.attname, format_type(t.oid, a.atttypmod) as typname, a.attnum, a.atttypmod as length, a.attnotnull, a.atthasdef, ad.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: $@"; $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); while (my $columnhash = $column_select->fetchrow_hashref ) { #data_type seems to not be populated; perhaps there needs to #be a mapping of query output to reserved constants in sqlt? my $col = $table->add_field( name => $$columnhash{'attname'}, default_value => $$columnhash{'adsrc'}, data_type => $$columnhash{'typname'}, order => $$columnhash{'attnum'}, ) || die $table->error; $col->{size} = [$$columnhash{'length'}] if $$columnhash{'length'}>0 && $$columnhash{'length'}<=0xFFFF; $col->{is_nullable} = $$columnhash{'attnotnull'} ? 0 : 1; $col->comments($$columnhash{'description'}) if $$columnhash{'description'}; } $index_select->execute($table_oid); my @column_names = $table->field_names(); 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_names[$_ - 1], 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_delete => $actions->{$on_upd}, on_update => $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-0.11021/lib/SQL/Translator/Parser/Access.pm0000644000175000017500000002636312163313615022324 0ustar ilmariilmaripackage 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.59'; 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-0.11021/lib/SQL/Translator/Parser/YAML.pm0000644000175000017500000000707212163313615021661 0ustar ilmariilmaripackage SQL::Translator::Parser::YAML; use strict; use warnings; our $VERSION = '1.59'; 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; } } # # 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-0.11021/lib/SQL/Translator/Parser/Sybase.pm0000644000175000017500000002470312163313615022345 0ustar ilmariilmaripackage 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.59'; 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-0.11021/lib/SQL/Translator/Parser/Oracle.pm0000644000175000017500000005427712421750412022332 0ustar ilmariilmaripackage 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.59'; 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 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[2]) =~ s/""/"/g; } SQSTRING : "'" /((?:[^']|'')*)/ "'" { ($return = $item[2]) =~ s/''/'/g } VALUE : /[-+]?\d*\.?\d+(?:[eE]\d+)?/ | SQSTRING | /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('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-0.11021/lib/SQL/Translator/Parser/JSON.pm0000644000175000017500000000713112234462467021675 0ustar ilmariilmaripackage SQL::Translator::Parser::JSON; use strict; use warnings; our $VERSION = '1.00'; use SQL::Translator::Schema; use SQL::Translator::Utils qw(header_comment); use Data::Dumper; use 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; } } # # 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-0.11021/lib/SQL/Translator/Parser/XML/0000755000175000017500000000000012462421250021210 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Parser/XML/SQLFairy.pm0000644000175000017500000002361512411004141023175 0ustar ilmariilmaripackage 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.59'; $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 /); # 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-0.11021/lib/SQL/Translator/Parser/Excel.pm0000644000175000017500000001345312163313615022157 0ustar ilmariilmaripackage 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.59'; 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-0.11021/lib/SQL/Translator/Parser/SQLite.pm0000644000175000017500000004513412421750412022256 0ustar ilmariilmaripackage 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.59'; 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, @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 | comment | create | /^\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 : CREATE TEMPORARY(?) TABLE table_name '(' definition(s /,/) ')' SEMICOLON { my $db_name = $item[4]->{'db_name'} || ''; my $table_name = $item[4]->{'name'}; $tables{ $table_name }{'name'} = $table_name; $tables{ $table_name }{'is_temporary'} = $item[2][0] ? 1 : 0; $tables{ $table_name }{'order'} = ++$table_order; for my $def ( @{ $item[6] } ) { 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 : /[^)]+/ 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[2]) =~ s/""/"/g } SQSTRING : "'" /((?:[^']|'')*)/ "'" { ($return = $item[2]) =~ 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'}, 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'}, ); } 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-0.11021/lib/SQL/Translator/Parser/DB2/0000755000175000017500000000000012462421250021117 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Parser/DB2/Grammar.pm0000644000175000017500001136424412163313615023065 0ustar ilmariilmaripackage 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-0.11021/lib/SQL/Translator/Parser/DBI.pm0000644000175000017500000001025312163313615021510 0ustar ilmariilmaripackage 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.59'; use constant DRIVERS => { mysql => 'MySQL', odbc => 'SQLServer', oracle => 'Oracle', pg => 'PostgreSQL', sqlite => 'SQLite', sybase => 'Sybase', pg => 'PostgreSQL', 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-0.11021/lib/SQL/Translator/Parser/DB2.pm0000644000175000017500000005541112163313615021466 0ustar ilmariilmaripackage 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-0.11021/lib/SQL/Translator/Parser/xSV.pm0000644000175000017500000001133712163313615021636 0ustar ilmariilmaripackage 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.59'; 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-0.11021/lib/SQL/Translator/Parser/XML.pm0000644000175000017500000000100512163313615021545 0ustar ilmariilmaripackage 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.59'; $DEBUG = 1 unless defined $DEBUG; use SQL::Translator::Parser::XML::SQLFairy; *parse = \&SQL::Translator::Parser::XML::SQLFairy::parse; 1; SQL-Translator-0.11021/lib/SQL/Translator/Parser/PostgreSQL.pm0000644000175000017500000007662512461721222023132 0ustar ilmariilmaripackage 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: Table: (http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=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 ) | 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/view.php?version=7.3&idoc=1&file=sql-createindex.html) CREATE [ UNIQUE ] INDEX index_name ON table [ USING acc_method ] ( column [ ops_name ] [, ...] ) [ 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 table: CREATE [ OR REPLACE ] VIEW view [ ( column name list ) ] AS SELECT query =cut use strict; use warnings; our $VERSION = '1.59'; 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 /,/) ')' 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], } ; } 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], } } 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 /[^;]+/ 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 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 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' }; } | /(timestamptz|timestamp)(?:\(\d\))?( with(?:out)? time zone)?/i { $return = { type => 'timestamp' . ($2||'') }; } | /text/i { $return = { type => 'text', size => 64_000, }; } | /(bit|box|cidr|circle|date|inet|line|lseg|macaddr|money|numeric|decimal|path|point|polygon|timetz|time|varchar|json|hstore)/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] } ); $return = { name => $item[2][0] || '', supertype => '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'}, 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 '(' /[^)]+/ ')' { $return = { type => 'check', expression => $item[3], } } | /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[2]) =~ s/""/"/g; } SQSTRING : "'" /((?:[^']|'')*)/ "'" { ($return = $item[2]) =~ s/''/'/g } VALUE : /[-+]?\d*\.?\d+(?:[eE]\d+)?/ | SQSTRING | /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 $index = $table->add_index( name => $idata->{'name'}, type => uc $idata->{'type'}, fields => $idata->{'fields'}, ) or die $table->error . ' ' . $table->name; } 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'}, expression => $cdata->{'expression'}, ) 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-0.11021/lib/SQL/Translator/Producer/0000755000175000017500000000000012462421250021077 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Producer/SQLServer.pm0000644000175000017500000000435212354235347023301 0ustar ilmariilmaripackage SQL::Translator::Producer::SQLServer; use strict; use warnings; our ( $DEBUG, $WARN ); our $VERSION = '1.59'; $DEBUG = 1 unless defined $DEBUG; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(debug header_comment); use SQL::Translator::Generator::DDL::SQLServer; sub produce { my $translator = shift; SQL::Translator::Generator::DDL::SQLServer->new( add_comments => !$translator->no_comments, add_drop_table => $translator->add_drop_table, )->schema($translator->schema) } 1; =head1 NAME SQL::Translator::Producer::SQLServer - MS SQLServer producer for SQL::Translator =head1 SYNOPSIS use SQL::Translator; my $t = SQL::Translator->new( parser => '...', producer => 'SQLServer' ); $t->translate; =head1 DESCRIPTION This is currently a thin wrapper around the nextgen L DDL maker. =head1 Extra Attributes =over 4 =item field.list List of values for an enum field. =back =head1 TODO * !! Write some tests !! * Reserved words list needs updating to SQLServer. * Triggers, Procedures and Views DO NOT WORK # Text of view is already a 'create view' statement so no need to # be fancy foreach ( $schema->get_views ) { my $name = $_->name(); $output .= "\n\n"; $output .= "--\n-- View: $name\n--\n\n" unless $no_comments; my $text = $_->sql(); $text =~ s/\r//g; $output .= "$text\nGO\n"; } # Text of procedure already has the 'create procedure' stuff # so there is no need to do anything fancy. However, we should # think about doing fancy stuff with granting permissions and # so on. foreach ( $schema->get_procedures ) { my $name = $_->name(); $output .= "\n\n"; $output .= "--\n-- Procedure: $name\n--\n\n" unless $no_comments; my $text = $_->sql(); $text =~ s/\r//g; $output .= "$text\nGO\n"; } =head1 SEE ALSO L =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-0.11021/lib/SQL/Translator/Producer/TT/0000755000175000017500000000000012462421250021426 5ustar ilmariilmariSQL-Translator-0.11021/lib/SQL/Translator/Producer/TT/Table.pm0000644000175000017500000002147012411004141023005 0ustar ilmariilmaripackage SQL::Translator::Producer::TT::Table; =pod =head1 NAME SQL::Translator::Producer::TT::Table - Produces output using the Template Toolkit from a SQL schema, per table. =head1 SYNOPSIS # Normal STDOUT version # my $translator = SQL::Translator->new( from => 'MySQL', filename => 'foo_schema.sql', to => 'TT::Table', producer_args => { tt_table => 'foo_table.tt', }, ); print $translator->translate; # To generate a file per table # my $translator = SQL::Translator->new( from => 'MySQL', filename => 'foo_schema.sql', to => 'TT::Table', producer_args => { tt_table => 'foo_table.tt.html', mk_files => 1, mk_files_base => "./doc/tables", mk_file_ext => ".html", on_exists => "replace", }, ); # # ./doc/tables/ now contains the templated tables as $tablename.html # =head1 DESCRIPTION Produces schema output using a given Template Tookit template, processing that template for each table in the schema. Optionally allows you to write the result for each table to a separate file. It needs one additional producer_arg of C which is the file name of the template to use. This template will be passed a template var of C, which is the current L table we are producing, which you can then use to walk the schema via the methods documented in that module. You also get C as a shortcut to the L for the table and C, the L object for this parse in case you want to get access to any of the options etc set here. Here's a brief example of what the template could look like: [% table.name %] ================ [% FOREACH field = table.get_fields %] [% field.name %] [% field.data_type %]([% field.size %]) [% END -%] See F for a more complete example. You can also set any of the options used to initialize the Template object by adding them to your producer_args. See Template Toolkit docs for details of the options. $translator = SQL::Translator->new( to => 'TT', producer_args => { ttfile => 'foo_template.tt', INCLUDE_PATH => '/foo/templates/tt', INTERPOLATE => 1, }, ); If you set C and its additional options the producer will write a separate file for each table in the schema. This is useful for producing things like HTML documentation where every table gets its own page (you could also use TTSchema producer to add an index page). It's also particularly good for code generation where you want to produce a class file per table. =head1 OPTIONS =over 4 =item tt_table File name of the template to run for each table. =item mk_files Set to true to output a file for each table in the schema (as well as returning the whole lot back to the Translalor and hence STDOUT). The file will be named after the table, with the optional C added and placed in the directory C. =item mk_files_ext Extension (without the dot) to add to the filename when using mk_files. =item mk_files_base = DIR Dir to build the table files into when using mk_files. Defaults to the current directory. =item mk_file_dir Set true and if the file needs to written to a directory that doesn't exist, it will be created first. =item on_exists [Default:replace] What to do if we are running with mk_files and a file already exists where we want to write our output. One of "skip", "die", "replace", "insert". The default is die. B - Over-write the existing file with the new one, clobbering anything already there. B - Leave the original file as it was and don't write the new version anywhere. B - Die with an existing file error. B - Insert the generated output into the file between a set of special comments (defined by the following options.) Any code between the comments will be overwritten (ie the results from a previous produce) but the rest of the file is left alone (your custom code). This is particularly useful for code generation as it allows you to generate schema derived code and then add your own custom code to the file. Then when the schema changes you just re-produce to insert the new code. =item insert_comment_start The comment to look for in the file when on_exists is C. Default is C. Must appear on it own line, with only whitespace either side, to be recognised. =item insert_comment_end The end comment to look for in the file when on_exists is C. Default is C. Must appear on it own line, with only whitespace either side, to be recognised. =back =cut use strict; use warnings; our ( $DEBUG, @EXPORT_OK ); our $VERSION = '1.59'; $DEBUG = 0 unless defined $DEBUG; use File::Path; use Template; use Data::Dumper; use Exporter; use base qw(Exporter); @EXPORT_OK = qw(produce); use SQL::Translator::Utils 'debug'; my $Translator; sub produce { $Translator = shift; local $DEBUG = $Translator->debug; my $scma = $Translator->schema; my $pargs = $Translator->producer_args; my $file = $pargs->{'tt_table'} or die "No template file given!"; $pargs->{on_exists} ||= "die"; debug "Processing template $file\n"; my $out; my $tt = Template->new( DEBUG => $DEBUG, ABSOLUTE => 1, # Set so we can use from the command line sensibly RELATIVE => 1, # Maybe the cmd line code should set it! Security! %$pargs, # Allow any TT opts to be passed in the producer_args ) || die "Failed to initialize Template object: ".Template->error; for my $tbl ( sort {$a->order <=> $b->order} $scma->get_tables ) { my $outtmp; $tt->process( $file, { translator => $Translator, schema => $scma, table => $tbl, }, \$outtmp ) or die "Error processing template '$file' for table '".$tbl->name ."': ".$tt->error; $out .= $outtmp; # Write out the file... write_file( table_file($tbl), $outtmp ) if $pargs->{mk_files}; } return $out; }; # Work out the filename for a given table. sub table_file { my ($tbl) = shift; my $pargs = $Translator->producer_args; my $root = $pargs->{mk_files_base}; my $ext = $pargs->{mk_file_ext}; return "$root/$tbl.$ext"; } # Write the src given to the file given, handling the on_exists arg. sub write_file { my ($file, $src) = @_; my $pargs = $Translator->producer_args; my $root = $pargs->{mk_files_base}; if ( -e $file ) { if ( $pargs->{on_exists} eq "skip" ) { warn "Skipping existing $file\n"; return 1; } elsif ( $pargs->{on_exists} eq "die" ) { die "File $file already exists.\n"; } elsif ( $pargs->{on_exists} eq "replace" ) { warn "Replacing $file.\n"; } elsif ( $pargs->{on_exists} eq "insert" ) { warn "Inserting into $file.\n"; $src = insert_code($file, $src); } else { die "Unknown on_exists action: $pargs->{on_exists}\n"; } } else { if ( my $interactive = -t STDIN && -t STDOUT ) { warn "Creating $file.\n"; } } my ($dir) = $file =~ m!^(.*)/!; # Want greedy, everything before the last / if ( $dir and not -d $dir and $pargs->{mk_file_dir} ) { mkpath($dir); } debug "Writing to $file\n"; open( FILE, ">$file") or die "Error opening file $file : $!\n"; print FILE $src; close(FILE); } # Reads file and inserts code between the insert comments and returns the new # source. sub insert_code { my ($file, $src) = @_; my $pargs = $Translator->producer_args; my $cstart = $pargs->{insert_comment_start} || "SQLF_INSERT_START"; my $cend = $pargs->{insert_comment_end} || "SQLF_INSERT_END"; # Slurp in the original file open ( FILE, "<", "$file") or die "Error opening file $file : $!\n"; local $/ = undef; my $orig = ; close(FILE); # Insert the new code between the insert comments unless ( $orig =~ s/^\s*?$cstart\s*?\n.*?^\s*?$cend\s*?\n/\n$cstart\n$src\n$cend\n/ms ) { warn "No insert done\n"; } return $orig; } 1; =pod =head1 AUTHOR Mark Addison Egrommit@users.sourceforge.netE. =head1 TODO - Some tests for the various on exists options (they have been tested implicitly through use in a project but need some proper tests). - More docs on code generation strategies. - Better hooks for filename generation. - Integrate with L and L. =head1 SEE ALSO SQL::Translator. =cut SQL-Translator-0.11021/lib/SQL/Translator/Producer/TT/Base.pm0000644000175000017500000002062412411004141022630 0ustar ilmariilmaripackage 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.59'; 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