SQL-Translator-0.11018/0000755000175000017500000000000012234461403013141 5ustar frewfrewSQL-Translator-0.11018/xt/0000755000175000017500000000000012234461403013574 5ustar frewfrewSQL-Translator-0.11018/xt/pod.t0000644000175000017500000000016312143357341014547 0ustar frewfrewuse Test::More; eval "use Test::Pod 1.14"; plan skip_all => 'Test::Pod 1.14 required' if $@; all_pod_files_ok(); SQL-Translator-0.11018/xt/eol.t0000644000175000017500000000054212143357341014545 0ustar frewfrewuse warnings; use strict; use Test::More; eval "use Test::EOL 1.1"; plan skip_all => 'Test::EOL 1.1 required' if $@; Test::EOL::all_perl_files_ok({ trailing_whitespace => 1}, qw|lib t xt script share/DiaUml|, ); # FIXME - Test::EOL declares 'no_plan' which conflicts with done_testing # https://github.com/schwern/test-more/issues/14 #done_testing; SQL-Translator-0.11018/xt/notabs.t0000644000175000017500000000052312143357341015253 0ustar frewfrewuse warnings; use strict; use Test::More; eval "use Test::NoTabs 1.1"; plan skip_all => 'Test::NoTabs 1.1 required' if $@; Test::NoTabs::all_perl_files_ok( qw|lib t xt script share/DiaUml|, ); # FIXME - Test::NoTabs declares 'no_plan' which conflicts with done_testing # https://github.com/schwern/test-more/issues/14 #done_testing; SQL-Translator-0.11018/share/0000755000175000017500000000000012234461403014243 5ustar frewfrewSQL-Translator-0.11018/share/DiaUml/0000755000175000017500000000000012234461403015416 5ustar frewfrewSQL-Translator-0.11018/share/DiaUml/uml-class.tt20000644000175000017500000000065112143357340017756 0ustar frewfrew[%# vim:ft=tt2 -%] [% INCLUDE 'uml-class-start.tt2' %] [%- FOREACH attributes; INCLUDE "uml-attribute.tt2"; END %] [% INCLUDE 'uml-class-end.tt2' %] SQL-Translator-0.11018/share/DiaUml/layer.tt20000644000175000017500000000021012143357340017161 0ustar frewfrew[%- DEFAULT name="Layer1" visible="true" %] [% content %] SQL-Translator-0.11018/share/DiaUml/schema.tt20000644000175000017500000000214412143357340017315 0ustar frewfrew[%# vim:ft=tt2 -%] [% WRAPPER diagram.tt2 %] [% WRAPPER layer.tt2 name="Background" %] [% FOREACH table IN schema.get_tables %] [% INCLUDE 'uml-class-start.tt2' name = table.name stereotype = 'Table' visible_operations = 'false' %] [% FOREACH field IN table.get_fields; SET type = field.data_type; SET type = "$type($field.size)" IF field.size; INCLUDE "uml-attribute.tt2" name = field.name stereotype = 'Field' type = type value = field.default_value ; END %] [% INCLUDE 'uml-class-end.tt2' %] [% END %] [% END %] [% END %] SQL-Translator-0.11018/share/DiaUml/uml-class-all.tt20000644000175000017500000000737512143357340020536 0ustar frewfrew[%# vim:ft=tt2 -%] #[% name %]# #[% stereotype %]# #[% comment %]# [% FOREACH attributes %] [% INCLUDE "uml-attribute.tt2" %] [% END %] SQL-Translator-0.11018/share/DiaUml/uml-class-end.tt20000644000175000017500000000004512143357340020517 0ustar frewfrew[%# vim:ft=tt2 -%] SQL-Translator-0.11018/share/DiaUml/uml-class-start.tt20000644000175000017500000000673612143357340021123 0ustar frewfrew[% # vim:ft=tt2 DEFAULT visible_operations='true' -%] #[% name %]# #[% stereotype %]# #[% comment %]# SQL-Translator-0.11018/share/DiaUml/uml-attribute.tt20000644000175000017500000000172712143357340020661 0ustar frewfrew[%# vim:ft=tt2 -%] [%- DEFAULT visibility=0 abstract="false" class_scope="false" %] #[% name %]# #[% type %]# #[% value %]# #[% comment %]# SQL-Translator-0.11018/share/DiaUml/diagram.tt20000644000175000017500000000411012143357340017454 0ustar frewfrew #A4# [% content %] SQL-Translator-0.11018/share/PrecompiledParsers/0000755000175000017500000000000012234461403020046 5ustar frewfrewSQL-Translator-0.11018/share/PrecompiledParsers/Parse/0000755000175000017500000000000012234461403021120 5ustar frewfrewSQL-Translator-0.11018/share/PrecompiledParsers/Parse/RecDescent/0000755000175000017500000000000012234461403023137 5ustar frewfrewSQL-Translator-0.11018/share/PrecompiledParsers/Parse/RecDescent/DDL/0000755000175000017500000000000012234461403023542 5ustar frewfrewSQL-Translator-0.11018/share/PrecompiledParsers/Parse/RecDescent/DDL/SQLT/0000755000175000017500000000000012234461403024325 5ustar frewfrewSQL-Translator-0.11018/share/PrecompiledParsers/Parse/RecDescent/DDL/SQLT/README0000644000175000017500000000014712143357340025212 0ustar frewfrewThe contents of this directory are automatically regenerated when invoking Makefile.PL in author mode. SQL-Translator-0.11018/MANIFEST0000644000175000017500000001433412234461315014301 0ustar frewfrewChanges inc/Module/AutoInstall.pm inc/Module/Install.pm inc/Module/Install/AuthorTests.pm inc/Module/Install/AutoInstall.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm inc/Module/Install/Include.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/ReadmeFromPod.pm inc/Module/Install/Scripts.pm inc/Module/Install/Share.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/SQL/Translator.pm lib/SQL/Translator/Diff.pm lib/SQL/Translator/Filter/DefaultExtra.pm lib/SQL/Translator/Filter/Globals.pm lib/SQL/Translator/Filter/Names.pm lib/SQL/Translator/Generator/DDL/PostgreSQL.pm lib/SQL/Translator/Generator/DDL/SQLite.pm lib/SQL/Translator/Generator/DDL/SQLServer.pm lib/SQL/Translator/Generator/Role/DDL.pm lib/SQL/Translator/Generator/Role/Quote.pm lib/SQL/Translator/Manual.pod lib/SQL/Translator/Parser.pm lib/SQL/Translator/Parser/Access.pm lib/SQL/Translator/Parser/DB2.pm lib/SQL/Translator/Parser/DB2/Grammar.pm lib/SQL/Translator/Parser/DBI.pm lib/SQL/Translator/Parser/DBI/DB2.pm lib/SQL/Translator/Parser/DBI/MySQL.pm lib/SQL/Translator/Parser/DBI/Oracle.pm lib/SQL/Translator/Parser/DBI/PostgreSQL.pm lib/SQL/Translator/Parser/DBI/SQLite.pm lib/SQL/Translator/Parser/DBI/SQLServer.pm lib/SQL/Translator/Parser/DBI/Sybase.pm lib/SQL/Translator/Parser/Excel.pm lib/SQL/Translator/Parser/JSON.pm lib/SQL/Translator/Parser/MySQL.pm lib/SQL/Translator/Parser/Oracle.pm lib/SQL/Translator/Parser/PostgreSQL.pm lib/SQL/Translator/Parser/SQLite.pm lib/SQL/Translator/Parser/SQLServer.pm lib/SQL/Translator/Parser/Storable.pm lib/SQL/Translator/Parser/Sybase.pm lib/SQL/Translator/Parser/XML.pm lib/SQL/Translator/Parser/XML/SQLFairy.pm lib/SQL/Translator/Parser/xSV.pm lib/SQL/Translator/Parser/YAML.pm lib/SQL/Translator/Producer.pm lib/SQL/Translator/Producer/ClassDBI.pm lib/SQL/Translator/Producer/DB2.pm lib/SQL/Translator/Producer/Diagram.pm lib/SQL/Translator/Producer/DiaUml.pm lib/SQL/Translator/Producer/Dumper.pm lib/SQL/Translator/Producer/GraphViz.pm lib/SQL/Translator/Producer/HTML.pm lib/SQL/Translator/Producer/JSON.pm lib/SQL/Translator/Producer/Latex.pm lib/SQL/Translator/Producer/MySQL.pm lib/SQL/Translator/Producer/Oracle.pm lib/SQL/Translator/Producer/POD.pm lib/SQL/Translator/Producer/PostgreSQL.pm lib/SQL/Translator/Producer/SQLite.pm lib/SQL/Translator/Producer/SQLServer.pm lib/SQL/Translator/Producer/Storable.pm lib/SQL/Translator/Producer/Sybase.pm lib/SQL/Translator/Producer/TT/Base.pm lib/SQL/Translator/Producer/TT/Table.pm lib/SQL/Translator/Producer/TTSchema.pm lib/SQL/Translator/Producer/XML.pm lib/SQL/Translator/Producer/XML/SQLFairy.pm lib/SQL/Translator/Producer/YAML.pm lib/SQL/Translator/Role/BuildArgs.pm lib/SQL/Translator/Role/Debug.pm lib/SQL/Translator/Role/Error.pm lib/SQL/Translator/Role/ListAttr.pm lib/SQL/Translator/Schema.pm lib/SQL/Translator/Schema/Constants.pm lib/SQL/Translator/Schema/Constraint.pm lib/SQL/Translator/Schema/Field.pm lib/SQL/Translator/Schema/Index.pm lib/SQL/Translator/Schema/Object.pm lib/SQL/Translator/Schema/Procedure.pm lib/SQL/Translator/Schema/Role/Compare.pm lib/SQL/Translator/Schema/Role/Extra.pm lib/SQL/Translator/Schema/Table.pm lib/SQL/Translator/Schema/Trigger.pm lib/SQL/Translator/Schema/View.pm lib/SQL/Translator/Types.pm lib/SQL/Translator/Utils.pm lib/Test/SQL/Translator.pm Makefile.PL MANIFEST This list of files META.yml README script/sqlt script/sqlt-diagram script/sqlt-diff script/sqlt-diff-old script/sqlt-dumper script/sqlt-graph script/sqlt.cgi share/DiaUml/diagram.tt2 share/DiaUml/layer.tt2 share/DiaUml/schema.tt2 share/DiaUml/uml-attribute.tt2 share/DiaUml/uml-class-all.tt2 share/DiaUml/uml-class-end.tt2 share/DiaUml/uml-class-start.tt2 share/DiaUml/uml-class.tt2 share/PrecompiledParsers/Parse/RecDescent/DDL/SQLT/README t/02mysql-parser.t t/03mysql-to-oracle.t t/04file,fh,string.t t/05bgep-re.t t/06xsv.t t/07p_args.t t/08postgres-to-mysql.t t/09sqlt-diagram.t t/10excel.t t/11normalize.t t/12header_comment.t t/13schema.t t/14postgres-parser.t t/15oracle-parser.t t/16xml-parser.t t/17sqlfxml-producer.t t/18ttschema-producer.t t/19sybase-parser.t t/20format_X_name.t t/23json.t t/24yaml.t t/25storable.t t/26sybase.t t/27sqlite-parser.t t/29html.t t/30sqlt-new-diff-mysql.t t/30sqlt-new-diff-pgsql.t t/30sqlt-new-diff-sqlite.t t/30sqlt-new-diff.t t/31dumper.t t/32schema-lookups.t t/33tt-table-producer.t t/34tt-base.t t/35-access-parser.t t/36-filters.t t/38-filter-names.t t/38-mysql-producer.t t/39-filter-globals.t t/40oracle-parser-dbi.t t/43xml-to-db2.t t/44-xml-to-db2-array.t t/45db2-producer.t t/46xml-to-pg.t t/47postgres-producer.t t/48xml-to-sqlite.t t/49xml-to-pg-samefield.t t/50-sqlserver-parser.t t/51-xml-to-oracle.t t/51-xml-to-oracle_quoted.t t/52-oracle-options.t t/53-oracle-delay-constraints.t t/53-oracle-delay-constraints_quoted.t t/54-oracle-alter-field.t t/55-oracle-add-field.t t/55-oracle-producer.t t/56-sqlite-producer.t t/57-class-dbi.t t/60roundtrip.t t/61translator_agnostic.t t/62roundtrip_datacheck.t t/63-spacial-pgsql.t t/64xml-to-mysql.t t/66-postgres-dbi-parser.t t/70sqlt-diff_script.t t/70sqlt-diff_script_old.t t/71-generator-sql_server.t t/72-sqlite-add-drop-fields.t t/73-sqlite-respects-quote.t t/74-filename-arrayref.t t/data/access/gdpdm.ddl t/data/diff/create1.yml t/data/diff/create2.yml t/data/diff/pgsql/create1.yml t/data/diff/pgsql/create2.yml t/data/Excel/t.xls t/data/mysql/Apache-Session-MySQL.sql t/data/mysql/BGEP-RE-create.sql t/data/mysql/cashmusic_db.sql t/data/mysql/create.sql t/data/mysql/create2.sql t/data/mysql/entire_syntax.sql t/data/mysql/sqlfxml-producer-basic.sql t/data/oracle/create.sql t/data/oracle/create2.sql t/data/oracle/schema_diff_a.yaml t/data/oracle/schema_diff_b.yaml t/data/oracle/schema_diff_c.yaml t/data/oracle/schema_with_options.yaml t/data/pgsql/Chado-CV-PostGreSQL.sql t/data/pgsql/entire_syntax.sql t/data/pgsql/turnkey.sql t/data/roundtrip.xml t/data/roundtrip_autogen.yaml t/data/sqlite/create.sql t/data/sqlite/create2.sql t/data/sqlite/named.sql t/data/sqlserver/create.sql t/data/sybase/create.sql t/data/template/basic.tt t/data/template/table.tt t/data/template/testresult_basic.txt t/data/template/testresult_table.txt t/data/xml/samefield.xml t/data/xml/schema.xml t/lib/Producer/BaseTest.pm t/mysql-sqlite-translate.t xt/eol.t xt/notabs.t xt/pod.t SQL-Translator-0.11018/README0000644000175000017500000003225212234461166014033 0ustar frewfrewNAME SQL::Translator - manipulate structured data definitions (SQL and more) SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new( # Print debug info debug => 1, # Print Parse::RecDescent trace trace => 0, # Don't include comments in output no_comments => 0, # Print name mutations, conflicts show_warnings => 0, # Add "drop table" statements add_drop_table => 1, # to quote or not to quote, thats the question quote_identifiers => 1, # Validate schema object validate => 1, # Make all table names CAPS in producers which support this option format_table_name => sub {my $tablename = shift; return uc($tablename)}, # Null-op formatting, only here for documentation's sake format_package_name => sub {return shift}, format_fk_name => sub {return shift}, format_pk_name => sub {return shift}, ); my $output = $translator->translate( from => 'MySQL', to => 'Oracle', # Or an arrayref of filenames, i.e. [ $file1, $file2, $file3 ] filename => $file, ) or die $translator->error; print $output; DESCRIPTION This documentation covers the API for SQL::Translator. For a more general discussion of how to use the modules and scripts, please see SQL::Translator::Manual. SQL::Translator is a group of Perl modules that converts vendor-specific SQL table definitions into other formats, such as other vendor-specific SQL, ER diagrams, documentation (POD and HTML), XML, and Class::DBI classes. The main focus of SQL::Translator is SQL, but parsers exist for other structured data formats, including Excel spreadsheets and arbitrarily delimited text files. Through the separation of the code into parsers and producers with an object model in between, it's possible to combine any parser with any producer, to plug in custom parsers or producers, or to manipulate the parsed data via the built-in object model. Presently only the definition parts of SQL are handled (CREATE, ALTER), not the manipulation of data (INSERT, UPDATE, DELETE). CONSTRUCTOR The constructor is called "new", and accepts a optional hash of options. Valid options are: * parser / from * parser_args * producer / to * producer_args * filters * filename / file * data * debug * add_drop_table * quote_identifiers * quote_table_names (DEPRECATED) * quote_field_names (DEPRECATED) * no_comments * trace * validate All options are, well, optional; these attributes can be set via instance methods. Internally, they are; no (non-syntactical) advantage is gained by passing options to the constructor. METHODS add_drop_table Toggles whether or not to add "DROP TABLE" statements just before the create definitions. quote_identifiers Toggles whether or not to quote identifiers (table, column, constraint, etc.) with a quoting mechanism suitable for the chosen Producer. The default (true) is to quote them. quote_table_names DEPRECATED - A legacy proxy to "quote_identifiers" quote_field_names DEPRECATED - A legacy proxy to "quote_identifiers" no_comments Toggles whether to print comments in the output. Accepts a true or false value, returns the current value. producer The "producer" method is an accessor/mutator, used to retrieve or define what subroutine is called to produce the output. A subroutine defined as a producer will be invoked as a function (*not a method*) and passed its container "SQL::Translator" instance, which it should call the "schema" method on, to get the "SQL::Translator::Schema" generated by the parser. It is expected that the function transform the schema structure to a string. The "SQL::Translator" instance is also useful for informational purposes; for example, the type of the parser can be retrieved using the "parser_type" method, and the "error" and "debug" methods can be called when needed. When defining a producer, one of several things can be passed in: A module name (e.g., "My::Groovy::Producer"), a module name relative to the "SQL::Translator::Producer" namespace (e.g., "MySQL"), a module name and function combination ("My::Groovy::Producer::transmogrify"), or a reference to an anonymous subroutine. If a full module name is passed in (for the purposes of this method, a string containing "::" is considered to be a module name), it is treated as a package, and a function called "produce" will be invoked: $modulename::produce. If $modulename cannot be loaded, the final portion is stripped off and treated as a function. In other words, if there is no file named My/Groovy/Producer/transmogrify.pm, "SQL::Translator" will attempt to load My/Groovy/Producer.pm and use "transmogrify" as the name of the function, instead of the default "produce". my $tr = SQL::Translator->new; # This will invoke My::Groovy::Producer::produce($tr, $data) $tr->producer("My::Groovy::Producer"); # This will invoke SQL::Translator::Producer::Sybase::produce($tr, $data) $tr->producer("Sybase"); # This will invoke My::Groovy::Producer::transmogrify($tr, $data), # assuming that My::Groovy::Producer::transmogrify is not a module # on disk. $tr->producer("My::Groovy::Producer::transmogrify"); # This will invoke the referenced subroutine directly, as # $subref->($tr, $data); $tr->producer(\&my_producer); There is also a method named "producer_type", which is a string containing the classname to which the above "produce" function belongs. In the case of anonymous subroutines, this method returns the string "CODE". Finally, there is a method named "producer_args", which is both an accessor and a mutator. Arbitrary data may be stored in name => value pairs for the producer subroutine to access: sub My::Random::producer { my ($tr, $data) = @_; my $pr_args = $tr->producer_args(); # $pr_args is a hashref. Extra data passed to the "producer" method is passed to "producer_args": $tr->producer("xSV", delimiter => ',\s*'); # In SQL::Translator::Producer::xSV: my $args = $tr->producer_args; my $delimiter = $args->{'delimiter'}; # value is ,\s* parser The "parser" method defines or retrieves a subroutine that will be called to perform the parsing. The basic idea is the same as that of "producer" (see above), except the default subroutine name is "parse", and will be invoked as "$module_name::parse($tr, $data)". Also, the parser subroutine will be passed a string containing the entirety of the data to be parsed. # Invokes SQL::Translator::Parser::MySQL::parse() $tr->parser("MySQL"); # Invokes My::Groovy::Parser::parse() $tr->parser("My::Groovy::Parser"); # Invoke an anonymous subroutine directly $tr->parser(sub { my $dumper = Data::Dumper->new([ $_[1] ], [ "SQL" ]); $dumper->Purity(1)->Terse(1)->Deepcopy(1); return $dumper->Dump; }); There is also "parser_type" and "parser_args", which perform analogously to "producer_type" and "producer_args" filters Set or retrieve the filters to run over the schema during the translation, before the producer creates its output. Filters are sub routines called, in order, with the schema object to filter as the 1st arg and a hash of options (passed as a list) for the rest of the args. They are free to do whatever they want to the schema object, which will be handed to any following filters, then used by the producer. Filters are set as an array, which gives the order they run in. Like parsers and producers, they can be defined by a module name, a module name relative to the SQL::Translator::Filter namespace, a module name and function name together or a reference to an anonymous subroutine. When using a module name a function called "filter" will be invoked in that package to do the work. To pass args to the filter set it as an array ref with the 1st value giving the filter (name or sub) and the rest its args. e.g. $tr->filters( sub { my $schema = shift; # Do stuff to schema here! }, DropFKeys, [ "Names", table => 'lc' ], [ "Foo", foo => "bar", hello => "world" ], [ "Filter5" ], ); Although you normally set them in the constructor, which calls through to filters. i.e. my $translator = SQL::Translator->new( ... filters => [ sub { ... }, [ "Names", table => 'lc' ], ], ... ); See t/36-filters.t for more examples. Multiple set calls to filters are cumulative with new filters added to the end of the current list. Returns the filters as a list of array refs, the 1st value being a reference to the filter sub and the rest its args. show_warnings Toggles whether to print warnings of name conflicts, identifier mutations, etc. Probably only generated by producers to let the user know when something won't translate very smoothly (e.g., MySQL "enum" fields into Oracle). Accepts a true or false value, returns the current value. translate The "translate" method calls the subroutine referenced by the "parser" data member, then calls any "filters" and finally calls the "producer" sub routine (these members are described above). It accepts as arguments a number of things, in key => value format, including (potentially) a parser and a producer (they are passed directly to the "parser" and "producer" methods). Here is how the parameter list to "translate" is parsed: * 1 argument means it's the data to be parsed; which could be a string (filename) or a reference to a scalar (a string stored in memory), or a reference to a hash, which is parsed as being more than one argument (see next section). # Parse the file /path/to/datafile my $output = $tr->translate("/path/to/datafile"); # Parse the data contained in the string $data my $output = $tr->translate(\$data); * More than 1 argument means its a hash of things, and it might be setting a parser, producer, or datasource (this key is named "filename" or "file" if it's a file, or "data" for a SCALAR reference. # As above, parse /path/to/datafile, but with different producers for my $prod ("MySQL", "XML", "Sybase") { print $tr->translate( producer => $prod, filename => "/path/to/datafile", ); } # The filename hash key could also be: datasource => \$data, You get the idea. filename, data Using the "filename" method, the filename of the data to be parsed can be set. This method can be used in conjunction with the "data" method, below. If both the "filename" and "data" methods are invoked as mutators, the data set in the "data" method is used. $tr->filename("/my/data/files/create.sql"); or: my $create_script = do { local $/; open CREATE, "/my/data/files/create.sql" or die $!; ; }; $tr->data(\$create_script); "filename" takes a string, which is interpreted as a filename. "data" takes a reference to a string, which is used as the data to be parsed. If a filename is set, then that file is opened and read when the "translate" method is called, as long as the data instance variable is not set. schema Returns the SQL::Translator::Schema object. trace Turns on/off the tracing option of Parse::RecDescent. validate Whether or not to validate the schema object after parsing and before producing. version Returns the version of the SQL::Translator release. AUTHORS See the included AUTHORS file: If you would like to contribute to the project, you can send patches to the developers mailing list: sqlfairy-developers@lists.sourceforge.net Or send us a message (with your Sourceforge username) asking to be added to the project and what you'd like to contribute. COPYRIGHT Copyright 2012 the SQL::Translator authors, as listed in "AUTHORS". LICENSE This library is free software and may be distributed under the same terms as Perl 5 itself. BUGS Please use for reporting bugs. PRAISE If you find this module useful, please use to rate it. SEE ALSO perl, SQL::Translator::Parser, SQL::Translator::Producer, Parse::RecDescent, GD, GraphViz, Text::RecordParser, Class::DBI, XML::Writer. SQL-Translator-0.11018/lib/0000755000175000017500000000000012234461403013707 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/0000755000175000017500000000000012234461403014346 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/0000755000175000017500000000000012234461403016477 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Manual.pod0000644000175000017500000004547612234455220020440 0ustar frewfrew=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.11018/lib/SQL/Translator/Filter/0000755000175000017500000000000012234461403017724 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Filter/DefaultExtra.pm0000644000175000017500000000307712143357340022664 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Filter/Names.pm0000644000175000017500000000665712143357340021346 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Filter/Globals.pm0000644000175000017500000001206312234455220021647 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Producer.pm0000644000175000017500000000504212143357340020624 0ustar frewfrewpackage 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 (undef, $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 { $$field_ref .= " DEFAULT '$default'"; } } 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.11018/lib/SQL/Translator/Schema/0000755000175000017500000000000012234461403017677 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Schema/Procedure.pm0000644000175000017500000001036112143357340022171 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Schema/Object.pm0000644000175000017500000000202612143357340021446 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Schema/Index.pm0000644000175000017500000001130712143357340021311 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Schema/Role/0000755000175000017500000000000012234461403020600 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Schema/Role/Extra.pm0000644000175000017500000000356612234455220022233 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Schema/Role/Compare.pm0000644000175000017500000000236412143357340022534 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Schema/Field.pm0000644000175000017500000003027412234455220021266 0ustar frewfrewpackage 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); 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, decimal => SQL_DECIMAL, numeric => SQL_NUMERIC, dec => SQL_DECIMAL, 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 ); =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; 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; 1; =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11018/lib/SQL/Translator/Schema/Constraint.pm0000644000175000017500000002753512234455220022375 0ustar frewfrewpackage 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 @tables = map { $table->get_field($_) || $_ } @{$self->field_names(@_) || []}; return wantarray ? @tables : @tables ? \@tables : 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.11018/lib/SQL/Translator/Schema/Trigger.pm0000644000175000017500000001737312143357340021656 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Schema/Constants.pm0000644000175000017500000000221412143357340022213 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Schema/View.pm0000644000175000017500000001041112234455220021144 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Schema/Table.pm0000644000175000017500000006304112234455220021270 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Role/0000755000175000017500000000000012234461403017400 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Role/ListAttr.pm0000644000175000017500000000562412234455220021513 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Role/Debug.pm0000644000175000017500000000145712143357340020776 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Role/BuildArgs.pm0000644000175000017500000000124312143357340021615 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Role/Error.pm0000644000175000017500000000304112143357340021030 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Types.pm0000644000175000017500000000463212234455220020146 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Schema.pm0000644000175000017500000004173612234455220020250 0ustar frewfrewpackage SQL::Translator::Schema; =pod =head1 NAME SQL::Translator::Schema - SQL::Translator schema object =head1 SYNOPSIS use SQL::Translator::Schema; my $schema = SQL::Translator::Schema->new( name => 'Foo', database => 'MySQL', ); my $table = $schema->add_table( name => 'foo' ); my $view = $schema->add_view( name => 'bar', sql => '...' ); =head1 DESCSIPTION C is the object that accepts, validates, and returns the database structure. =head1 METHODS =cut use Moo; use SQL::Translator::Schema::Constants; use SQL::Translator::Schema::Procedure; use SQL::Translator::Schema::Table; use SQL::Translator::Schema::Trigger; use SQL::Translator::Schema::View; use Sub::Quote qw(quote_sub); use SQL::Translator::Utils 'parse_list_arg'; use Carp; extends 'SQL::Translator::Schema::Object'; our $VERSION = '1.59'; has _order => (is => 'ro', default => quote_sub(q{ +{ map { $_ => 0 } qw/ table view trigger proc /} }), ); sub as_graph_pm { =pod =head2 as_graph_pm Returns a Graph::Directed object with the table names for nodes. =cut require Graph::Directed; my $self = shift; my $g = Graph::Directed->new; for my $table ( $self->get_tables ) { my $tname = $table->name; $g->add_vertex( $tname ); for my $field ( $table->get_fields ) { if ( $field->is_foreign_key ) { my $fktable = $field->foreign_key_reference->reference_table; $g->add_edge( $fktable, $tname ); } } } return $g; } has _tables => ( is => 'ro', init_arg => undef, default => quote_sub(q{ +{} }) ); sub add_table { =pod =head2 add_table Add a table object. Returns the new SQL::Translator::Schema::Table object. The "name" parameter is required. If you try to create a table with the same name as an existing table, you will get an error and the table will not be created. my $t1 = $schema->add_table( name => 'foo' ) or die $schema->error; my $t2 = SQL::Translator::Schema::Table->new( name => 'bar' ); $t2 = $schema->add_table( $table_bar ) or die $schema->error; =cut my $self = shift; my $table_class = 'SQL::Translator::Schema::Table'; my $table; if ( UNIVERSAL::isa( $_[0], $table_class ) ) { $table = shift; $table->schema($self); } else { my %args = ref $_[0] eq 'HASH' ? %{ $_[0] } : @_; $args{'schema'} = $self; $table = $table_class->new( \%args ) or return $self->error( $table_class->error ); } $table->order( ++$self->_order->{table} ); # We know we have a name as the Table->new above errors if none given. my $table_name = $table->name; if ( defined $self->_tables->{$table_name} ) { return $self->error(qq[Can't use table name "$table_name": table exists]); } else { $self->_tables->{$table_name} = $table; } return $table; } sub drop_table { =pod =head2 drop_table Remove a table from the schema. Returns the table object if the table was found and removed, an error otherwise. The single parameter can be either a table name or an C object. The "cascade" parameter can be set to 1 to also drop all triggers on the table, default is 0. $schema->drop_table('mytable'); $schema->drop_table('mytable', cascade => 1); =cut my $self = shift; my $table_class = 'SQL::Translator::Schema::Table'; my $table_name; if ( UNIVERSAL::isa( $_[0], $table_class ) ) { $table_name = shift->name; } else { $table_name = shift; } my %args = @_; my $cascade = $args{'cascade'}; if ( !exists $self->_tables->{$table_name} ) { return $self->error(qq[Can't drop table: "$table_name" doesn't exist]); } my $table = delete $self->_tables->{$table_name}; if ($cascade) { # Drop all triggers on this table $self->drop_trigger() for ( grep { $_->on_table eq $table_name } values %{ $self->_triggers } ); } return $table; } has _procedures => ( is => 'ro', init_arg => undef, default => quote_sub(q{ +{} }) ); sub add_procedure { =pod =head2 add_procedure Add a procedure object. Returns the new SQL::Translator::Schema::Procedure object. The "name" parameter is required. If you try to create a procedure with the same name as an existing procedure, you will get an error and the procedure will not be created. my $p1 = $schema->add_procedure( name => 'foo' ); my $p2 = SQL::Translator::Schema::Procedure->new( name => 'bar' ); $p2 = $schema->add_procedure( $procedure_bar ) or die $schema->error; =cut my $self = shift; my $procedure_class = 'SQL::Translator::Schema::Procedure'; my $procedure; if ( UNIVERSAL::isa( $_[0], $procedure_class ) ) { $procedure = shift; $procedure->schema($self); } else { my %args = ref $_[0] eq 'HASH' ? %{ $_[0] } : @_; $args{'schema'} = $self; return $self->error('No procedure name') unless $args{'name'}; $procedure = $procedure_class->new( \%args ) or return $self->error( $procedure_class->error ); } $procedure->order( ++$self->_order->{proc} ); my $procedure_name = $procedure->name or return $self->error('No procedure name'); if ( defined $self->_procedures->{$procedure_name} ) { return $self->error( qq[Can't create procedure: "$procedure_name" exists] ); } else { $self->_procedures->{$procedure_name} = $procedure; } return $procedure; } sub drop_procedure { =pod =head2 drop_procedure Remove a procedure from the schema. Returns the procedure object if the procedure was found and removed, an error otherwise. The single parameter can be either a procedure name or an C object. $schema->drop_procedure('myprocedure'); =cut my $self = shift; my $proc_class = 'SQL::Translator::Schema::Procedure'; my $proc_name; if ( UNIVERSAL::isa( $_[0], $proc_class ) ) { $proc_name = shift->name; } else { $proc_name = shift; } if ( !exists $self->_procedures->{$proc_name} ) { return $self->error( qq[Can't drop procedure: "$proc_name" doesn't exist]); } my $proc = delete $self->_procedures->{$proc_name}; return $proc; } has _triggers => ( is => 'ro', init_arg => undef, default => quote_sub(q{ +{} }) ); sub add_trigger { =pod =head2 add_trigger Add a trigger object. Returns the new SQL::Translator::Schema::Trigger object. The "name" parameter is required. If you try to create a trigger with the same name as an existing trigger, you will get an error and the trigger will not be created. my $t1 = $schema->add_trigger( name => 'foo' ); my $t2 = SQL::Translator::Schema::Trigger->new( name => 'bar' ); $t2 = $schema->add_trigger( $trigger_bar ) or die $schema->error; =cut my $self = shift; my $trigger_class = 'SQL::Translator::Schema::Trigger'; my $trigger; if ( UNIVERSAL::isa( $_[0], $trigger_class ) ) { $trigger = shift; $trigger->schema($self); } else { my %args = ref $_[0] eq 'HASH' ? %{ $_[0] } : @_; $args{'schema'} = $self; return $self->error('No trigger name') unless $args{'name'}; $trigger = $trigger_class->new( \%args ) or return $self->error( $trigger_class->error ); } $trigger->order( ++$self->_order->{trigger} ); my $trigger_name = $trigger->name or return $self->error('No trigger name'); if ( defined $self->_triggers->{$trigger_name} ) { return $self->error(qq[Can't create trigger: "$trigger_name" exists]); } else { $self->_triggers->{$trigger_name} = $trigger; } return $trigger; } sub drop_trigger { =pod =head2 drop_trigger Remove a trigger from the schema. Returns the trigger object if the trigger was found and removed, an error otherwise. The single parameter can be either a trigger name or an C object. $schema->drop_trigger('mytrigger'); =cut my $self = shift; my $trigger_class = 'SQL::Translator::Schema::Trigger'; my $trigger_name; if ( UNIVERSAL::isa( $_[0], $trigger_class ) ) { $trigger_name = shift->name; } else { $trigger_name = shift; } if ( !exists $self->_triggers->{$trigger_name} ) { return $self->error( qq[Can't drop trigger: "$trigger_name" doesn't exist]); } my $trigger = delete $self->_triggers->{$trigger_name}; return $trigger; } has _views => ( is => 'ro', init_arg => undef, default => quote_sub(q{ +{} }) ); sub add_view { =pod =head2 add_view Add a view object. Returns the new SQL::Translator::Schema::View object. The "name" parameter is required. If you try to create a view with the same name as an existing view, you will get an error and the view will not be created. my $v1 = $schema->add_view( name => 'foo' ); my $v2 = SQL::Translator::Schema::View->new( name => 'bar' ); $v2 = $schema->add_view( $view_bar ) or die $schema->error; =cut my $self = shift; my $view_class = 'SQL::Translator::Schema::View'; my $view; if ( UNIVERSAL::isa( $_[0], $view_class ) ) { $view = shift; $view->schema($self); } else { my %args = ref $_[0] eq 'HASH' ? %{ $_[0] } : @_; $args{'schema'} = $self; return $self->error('No view name') unless $args{'name'}; $view = $view_class->new( \%args ) or return $view_class->error; } $view->order( ++$self->_order->{view} ); my $view_name = $view->name or return $self->error('No view name'); if ( defined $self->_views->{$view_name} ) { return $self->error(qq[Can't create view: "$view_name" exists]); } else { $self->_views->{$view_name} = $view; } return $view; } sub drop_view { =pod =head2 drop_view Remove a view from the schema. Returns the view object if the view was found and removed, an error otherwise. The single parameter can be either a view name or an C object. $schema->drop_view('myview'); =cut my $self = shift; my $view_class = 'SQL::Translator::Schema::View'; my $view_name; if ( UNIVERSAL::isa( $_[0], $view_class ) ) { $view_name = shift->name; } else { $view_name = shift; } if ( !exists $self->_views->{$view_name} ) { return $self->error(qq[Can't drop view: "$view_name" doesn't exist]); } my $view = delete $self->_views->{$view_name}; return $view; } =head2 database Get or set the schema's database. (optional) my $database = $schema->database('PostgreSQL'); =cut has database => ( is => 'rw', default => quote_sub(q{ '' }) ); sub is_valid { =pod =head2 is_valid Returns true if all the tables and views are valid. my $ok = $schema->is_valid or die $schema->error; =cut my $self = shift; return $self->error('No tables') unless $self->get_tables; for my $object ( $self->get_tables, $self->get_views ) { return $object->error unless $object->is_valid; } return 1; } sub get_procedure { =pod =head2 get_procedure Returns a procedure by the name provided. my $procedure = $schema->get_procedure('foo'); =cut my $self = shift; my $procedure_name = shift or return $self->error('No procedure name'); return $self->error(qq[Table "$procedure_name" does not exist]) unless exists $self->_procedures->{$procedure_name}; return $self->_procedures->{$procedure_name}; } sub get_procedures { =pod =head2 get_procedures Returns all the procedures as an array or array reference. my @procedures = $schema->get_procedures; =cut my $self = shift; my @procedures = map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [ $_->order, $_ ] } values %{ $self->_procedures }; if (@procedures) { return wantarray ? @procedures : \@procedures; } else { $self->error('No procedures'); return; } } sub get_table { =pod =head2 get_table Returns a table by the name provided. my $table = $schema->get_table('foo'); =cut my $self = shift; my $table_name = shift or return $self->error('No table name'); my $case_insensitive = shift; if ( $case_insensitive ) { $table_name = uc($table_name); foreach my $table ( keys %{$self->_tables} ) { return $self->_tables->{$table} if $table_name eq uc($table); } return $self->error(qq[Table "$table_name" does not exist]); } return $self->error(qq[Table "$table_name" does not exist]) unless exists $self->_tables->{$table_name}; return $self->_tables->{$table_name}; } sub get_tables { =pod =head2 get_tables Returns all the tables as an array or array reference. my @tables = $schema->get_tables; =cut my $self = shift; my @tables = map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [ $_->order, $_ ] } values %{ $self->_tables }; if (@tables) { return wantarray ? @tables : \@tables; } else { $self->error('No tables'); return; } } sub get_trigger { =pod =head2 get_trigger Returns a trigger by the name provided. my $trigger = $schema->get_trigger('foo'); =cut my $self = shift; my $trigger_name = shift or return $self->error('No trigger name'); return $self->error(qq[Trigger "$trigger_name" does not exist]) unless exists $self->_triggers->{$trigger_name}; return $self->_triggers->{$trigger_name}; } sub get_triggers { =pod =head2 get_triggers Returns all the triggers as an array or array reference. my @triggers = $schema->get_triggers; =cut my $self = shift; my @triggers = map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [ $_->order, $_ ] } values %{ $self->_triggers }; if (@triggers) { return wantarray ? @triggers : \@triggers; } else { $self->error('No triggers'); return; } } sub get_view { =pod =head2 get_view Returns a view by the name provided. my $view = $schema->get_view('foo'); =cut my $self = shift; my $view_name = shift or return $self->error('No view name'); return $self->error('View "$view_name" does not exist') unless exists $self->_views->{$view_name}; return $self->_views->{$view_name}; } sub get_views { =pod =head2 get_views Returns all the views as an array or array reference. my @views = $schema->get_views; =cut my $self = shift; my @views = map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [ $_->order, $_ ] } values %{ $self->_views }; if (@views) { return wantarray ? @views : \@views; } else { $self->error('No views'); return; } } sub make_natural_joins { =pod =head2 make_natural_joins Creates foreign key relationships among like-named fields in different tables. Accepts the following arguments: =over 4 =item * join_pk_only A True or False argument which determines whether or not to perform the joins from primary keys to fields of the same name in other tables =item * skip_fields A list of fields to skip in the joins =back $schema->make_natural_joins( join_pk_only => 1, skip_fields => 'name,department_id', ); =cut my $self = shift; my %args = @_; my $join_pk_only = $args{'join_pk_only'} || 0; my %skip_fields = map { s/^\s+|\s+$//g; $_, 1 } @{ parse_list_arg( $args{'skip_fields'} ) }; my ( %common_keys, %pk ); for my $table ( $self->get_tables ) { for my $field ( $table->get_fields ) { my $field_name = $field->name or next; next if $skip_fields{$field_name}; $pk{$field_name} = 1 if $field->is_primary_key; push @{ $common_keys{$field_name} }, $table->name; } } for my $field ( keys %common_keys ) { next if $join_pk_only and !defined $pk{$field}; my @table_names = @{ $common_keys{$field} }; next unless scalar @table_names > 1; for my $i ( 0 .. $#table_names ) { my $table1 = $self->get_table( $table_names[$i] ) or next; for my $j ( 1 .. $#table_names ) { my $table2 = $self->get_table( $table_names[$j] ) or next; next if $table1->name eq $table2->name; $table1->add_constraint( type => FOREIGN_KEY, fields => $field, reference_table => $table2->name, reference_fields => $field, ); } } } return 1; } =head2 name Get or set the schema's name. (optional) my $schema_name = $schema->name('Foo Database'); =cut has name => ( is => 'rw', default => quote_sub(q{ '' }) ); =pod =head2 translator Get the SQL::Translator instance that instantiated the parser. =cut has translator => ( is => 'rw', weak_ref => 1 ); 1; =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11018/lib/SQL/Translator/Utils.pm0000644000175000017500000003340512143357340020145 0ustar frewfrewpackage SQL::Translator::Utils; use strict; use warnings; use Digest::SHA qw( sha1_hex ); use File::Spec; use Scalar::Util qw(blessed); use Try::Tiny; use Carp qw(carp); our $VERSION = '1.59'; our $DEFAULT_COMMENT = '-- '; use base qw(Exporter); our @EXPORT_OK = qw( debug normalize_name header_comment parse_list_arg truncate_id_uniquely $DEFAULT_COMMENT parse_mysql_version parse_dbms_version ddl_parser_instance throw ex2err carp_ro ); use constant COLLISION_TAG_LENGTH => 8; sub debug { my ($pkg, $file, $line, $sub) = caller(0); { no strict qw(refs); return unless ${"$pkg\::DEBUG"}; } $sub =~ s/^$pkg\:://; while (@_) { my $x = shift; chomp $x; $x =~ s/\bPKG\b/$pkg/g; $x =~ s/\bLINE\b/$line/g; $x =~ s/\bSUB\b/$sub/g; #warn '[' . $x . "]\n"; print STDERR '[' . $x . "]\n"; } } sub normalize_name { my $name = shift or return ''; # The name can only begin with a-zA-Z_; if there's anything # else, prefix with _ $name =~ s/^([^a-zA-Z_])/_$1/; # anything other than a-zA-Z0-9_ in the non-first position # needs to be turned into _ $name =~ tr/[a-zA-Z0-9_]/_/c; # All duplicated _ need to be squashed into one. $name =~ tr/_/_/s; # Trim a trailing _ $name =~ s/_$//; return $name; } sub header_comment { my $producer = shift || caller; my $comment_char = shift; my $now = scalar localtime; $comment_char = $DEFAULT_COMMENT unless defined $comment_char; my $header_comment =<<"HEADER_COMMENT"; ${comment_char} ${comment_char}Created by $producer ${comment_char}Created on $now ${comment_char} HEADER_COMMENT # Any additional stuff passed in for my $additional_comment (@_) { $header_comment .= "${comment_char}${additional_comment}\n"; } return $header_comment; } sub parse_list_arg { my $list = UNIVERSAL::isa( $_[0], 'ARRAY' ) ? shift : [ @_ ]; # # This protects stringification of references. # if ( @$list && ref $list->[0] ) { return $list; } # # This processes string-like arguments. # else { return [ map { s/^\s+|\s+$//g; $_ } map { split /,/ } grep { defined && length } @$list ]; } } sub truncate_id_uniquely { my ( $desired_name, $max_symbol_length ) = @_; return $desired_name unless defined $desired_name && length $desired_name > $max_symbol_length; my $truncated_name = substr $desired_name, 0, $max_symbol_length - COLLISION_TAG_LENGTH - 1; # Hex isn't the most space-efficient, but it skirts around allowed # charset issues my $digest = sha1_hex($desired_name); my $collision_tag = substr $digest, 0, COLLISION_TAG_LENGTH; return $truncated_name . '_' . $collision_tag; } sub parse_mysql_version { my ($v, $target) = @_; return undef unless $v; $target ||= 'perl'; my @vers; # X.Y.Z style if ( $v =~ / ^ (\d+) \. (\d{1,3}) (?: \. (\d{1,3}) )? $ /x ) { push @vers, $1, $2, $3; } # XYYZZ (mysql) style elsif ( $v =~ / ^ (\d) (\d{2}) (\d{2}) $ /x ) { push @vers, $1, $2, $3; } # XX.YYYZZZ (perl) style or simply X elsif ( $v =~ / ^ (\d+) (?: \. (\d{3}) (\d{3}) )? $ /x ) { push @vers, $1, $2, $3; } else { #how do I croak sanely here? die "Unparseable MySQL version '$v'"; } if ($target eq 'perl') { return sprintf ('%d.%03d%03d', map { $_ || 0 } (@vers) ); } elsif ($target eq 'mysql') { return sprintf ('%d%02d%02d', map { $_ || 0 } (@vers) ); } else { #how do I croak sanely here? die "Unknown version target '$target'"; } } sub parse_dbms_version { my ($v, $target) = @_; return undef unless $v; my @vers; # X.Y.Z style if ( $v =~ / ^ (\d+) \. (\d{1,3}) (?: \. (\d{1,3}) )? $ /x ) { push @vers, $1, $2, $3; } # XX.YYYZZZ (perl) style or simply X elsif ( $v =~ / ^ (\d+) (?: \. (\d{3}) (\d{3}) )? $ /x ) { push @vers, $1, $2, $3; } else { #how do I croak sanely here? die "Unparseable database server version '$v'"; } if ($target eq 'perl') { return sprintf ('%d.%03d%03d', map { $_ || 0 } (@vers) ); } elsif ($target eq 'native') { return join '.' => grep defined, @vers; } else { #how do I croak sanely here? die "Unknown version target '$target'"; } } #my ($parsers_libdir, $checkout_dir); sub ddl_parser_instance { my $type = shift; # it may differ from our caller, even though currently this is not the case eval "require SQL::Translator::Parser::$type" or die "Unable to load grammar-spec container SQL::Translator::Parser::$type:\n$@"; # handle DB2 in a special way, since the grammar source was lost :( if ($type eq 'DB2') { require SQL::Translator::Parser::DB2::Grammar; return SQL::Translator::Parser::DB2::Grammar->new; } require Parse::RecDescent; return Parse::RecDescent->new(do { no strict 'refs'; ${"SQL::Translator::Parser::${type}::GRAMMAR"} || die "No \$SQL::Translator::Parser::${type}::GRAMMAR defined, unable to instantiate PRD parser\n" }); # this is disabled until RT#74593 is resolved =begin for general sadness unless ($parsers_libdir) { # are we in a checkout? if ($checkout_dir = _find_co_root()) { $parsers_libdir = File::Spec->catdir($checkout_dir, 'share', 'PrecompiledParsers'); } else { require File::ShareDir; $parsers_libdir = File::Spec->catdir( File::ShareDir::dist_dir('SQL-Translator'), 'PrecompiledParsers' ); } unshift @INC, $parsers_libdir; } my $precompiled_mod = "Parse::RecDescent::DDL::SQLT::$type"; # FIXME FIXME FIXME # Parse::RecDescent has horrible architecture where each precompiled parser # instance shares global state with all its siblings # What we do here is gross, but scarily efficient - the parser compilation # is much much slower than an unload/reload cycle require Class::Unload; Class::Unload->unload($precompiled_mod); # There is also a sub-namespace that P::RD uses, but simply unsetting # $^W to stop redefine warnings seems to be enough #Class::Unload->unload("Parse::RecDescent::$precompiled_mod"); eval "local \$^W; require $precompiled_mod" or do { if ($checkout_dir) { die "Unable to find precompiled grammar for $type - run Makefile.PL to generate it\n"; } else { die "Unable to load precompiled grammar for $type... this is not supposed to happen if you are not in a checkout, please file a bugreport:\n$@" } }; my $grammar_spec_fn = $INC{"SQL/Translator/Parser/$type.pm"}; my $precompiled_fn = $INC{"Parse/RecDescent/DDL/SQLT/$type.pm"}; if ( (stat($grammar_spec_fn))[9] > (stat($precompiled_fn))[9] ) { die ( "Grammar spec '$grammar_spec_fn' is newer than precompiled parser '$precompiled_fn'" . ($checkout_dir ? " - run Makefile.PL to regenerate stale versions\n" : "... this is not supposed to happen if you are not in a checkout, please file a bugreport\n" ) ); } return $precompiled_mod->new; =cut } # Try to determine the root of a checkout/untar if possible # or return undef sub _find_co_root { my @mod_parts = split /::/, (__PACKAGE__ . '.pm'); my $rel_path = join ('/', @mod_parts); # %INC stores paths with / regardless of OS return undef unless ($INC{$rel_path}); # a bit convoluted, but what we do here essentially is: # - get the file name of this particular module # - do 'cd ..' as many times as necessary to get to lib/SQL/Translator/../../.. my $root = (File::Spec::Unix->splitpath($INC{$rel_path}))[1]; for (1 .. @mod_parts) { $root = File::Spec->catdir($root, File::Spec->updir); } return ( -f File::Spec->catfile($root, 'Makefile.PL') ) ? $root : undef ; } { package SQL::Translator::Utils::Error; use overload '""' => sub { ${$_[0]} }, fallback => 1; sub new { my ($class, $msg) = @_; bless \$msg, $class; } } sub throw { die SQL::Translator::Utils::Error->new($_[0]); } sub ex2err { my ($orig, $self, @args) = @_; return try { $self->$orig(@args); } catch { die $_ unless blessed($_) && $_->isa("SQL::Translator::Utils::Error"); $self->error("$_"); }; } sub carp_ro { my ($name) = @_; return sub { my ($orig, $self) = (shift, shift); carp "'$name' is a read-only accessor" if @_; return $self->$orig; }; } 1; =pod =head1 NAME SQL::Translator::Utils - SQL::Translator Utility functions =head1 SYNOPSIS use SQL::Translator::Utils qw(debug); debug("PKG: Bad things happened"); =head1 DESCSIPTION C contains utility functions designed to be used from the other modules within the C modules. Nothing is exported by default. =head1 EXPORTED FUNCTIONS AND CONSTANTS =head2 debug C takes 0 or more messages, which will be sent to STDERR using C. Occurances of the strings I, I, and I will be replaced by the calling package, subroutine, and line number, respectively, as reported by C. For example, from within C in F, at line 666: debug("PKG: Error reading file at SUB/LINE"); Will warn [SQL::Translator: Error reading file at foo/666] The entire message is enclosed within C<[> and C<]> for visual clarity when STDERR is intermixed with STDOUT. =head2 normalize_name C takes a string and ensures that it is suitable for use as an identifier. This means: ensure that it starts with a letter or underscore, and that the rest of the string consists of only letters, numbers, and underscores. A string that begins with something other than [a-zA-Z] will be prefixer with an underscore, and all other characters in the string will be replaced with underscores. Finally, a trailing underscore will be removed, because that's ugly. normalize_name("Hello, world"); Produces: Hello_world A more useful example, from the C test suite: normalize_name("silly field (with random characters)"); returns: silly_field_with_random_characters =head2 header_comment Create the header comment. Takes 1 mandatory argument (the producer classname), an optional comment character (defaults to $DEFAULT_COMMENT), and 0 or more additional comments, which will be appended to the header, prefixed with the comment character. If additional comments are provided, then a comment string must be provided ($DEFAULT_COMMENT is exported for this use). For example, this: package My::Producer; use SQL::Translator::Utils qw(header_comment $DEFAULT_COMMENT); print header_comment(__PACKAGE__, $DEFAULT_COMMENT, "Hi mom!"); produces: -- -- Created by My::Prodcuer -- Created on Fri Apr 25 06:56:02 2003 -- -- Hi mom! -- Note the gratuitous spacing. =head2 parse_list_arg Takes a string, list or arrayref (all of which could contain comma-separated values) and returns an array reference of the values. All of the following will return equivalent values: parse_list_arg('id'); parse_list_arg('id', 'name'); parse_list_arg( 'id, name' ); parse_list_arg( [ 'id', 'name' ] ); parse_list_arg( qw[ id name ] ); =head2 truncate_id_uniquely Takes a string ($desired_name) and int ($max_symbol_length). Truncates $desired_name to $max_symbol_length by including part of the hash of the full name at the end of the truncated name, giving a high probability that the symbol will be unique. For example, truncate_id_uniquely( 'a' x 100, 64 ) truncate_id_uniquely( 'a' x 99 . 'b', 64 ); truncate_id_uniquely( 'a' x 99, 64 ) Will give three different results; specifically: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_7f900025 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_6191e39a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_8cd96af2 =head2 $DEFAULT_COMMENT This is the default comment string, '-- ' by default. Useful for C. =head2 parse_mysql_version Used by both L and L in order to provide a consistent format for both C<< parser_args->{mysql_parser_version} >> and C<< producer_args->{mysql_version} >> respectively. Takes any of the following version specifications: 5.0.3 4.1 3.23.2 5 5.001005 (perl style) 30201 (mysql style) =head2 parse_dbms_version Takes a version string (X.Y.Z) or perl style (XX.YYYZZZ) and a target ('perl' or 'native') transforms the string to the given target style. to =head2 throw Throws the provided string as an object that will stringify back to the original string. This stops it from being mangled by L's C code. =head2 ex2err Wraps an attribute accessor to catch any exception raised using L and store them in C<< $self->error() >>, finally returning undef. A reference to this function can be passed directly to L. around foo => \&ex2err; around bar => sub { my ($orig, $self) = (shift, shift); return ex2err($orig, $self, @_) if @_; ... }; =head2 carp_ro Takes a field name and returns a reference to a function can be used L a read-only accessor to make it L instead of die when passed an argument. =head1 AUTHORS Darren Chamberlain Edarren@cpan.orgE, Ken Y. Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11018/lib/SQL/Translator/Parser/0000755000175000017500000000000012234461403017733 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Parser/DB2/0000755000175000017500000000000012234461403020302 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Parser/DB2/Grammar.pm0000644000175000017500001136424412143357340022250 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/DB2.pm0000644000175000017500000005541112143357340020651 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/SQLite.pm0000644000175000017500000004511012234455220021433 0ustar frewfrewpackage 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+)["']?/ { $return = $1 } VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ { $item[1] } | /'.*?'/ { # remove leading/trailing quotes my $val = $item[1]; $val =~ s/^['"]|['"]$//g; $return = $val; } | /NULL/ { '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.11018/lib/SQL/Translator/Parser/Access.pm0000644000175000017500000002636312143357340021507 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/DBI/0000755000175000017500000000000012234461403020331 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Parser/DBI/Sybase.pm0000644000175000017500000002105112234455220022114 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/DBI/Oracle.pm0000644000175000017500000000733512143357340022107 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/DBI/MySQL.pm0000644000175000017500000000316612143357340021645 0ustar frewfrewpackage 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; for my $table_name ( @table_names ) { next if (grep /^$table_name$/, @skip_tables); my $sth = $dbh->prepare("show create table $table_name"); $sth->execute; my $table = $sth->fetchrow_hashref; $create .= $table->{'create table'} . ";\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.11018/lib/SQL/Translator/Parser/DBI/SQLServer.pm0000644000175000017500000002364212234455220022524 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/DBI/DB2.pm0000644000175000017500000001666712143357340021261 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/DBI/SQLite.pm0000644000175000017500000000262212143357340022035 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm0000644000175000017500000001617112143357340022703 0ustar frewfrewpackage 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, ARRAY(SELECT a.attname FROM pg_attribute a WHERE a.attrelid=i.indrelid AND a.attnum = ANY(i.indkey) ) AS attname, 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 $type; if ($$indexhash{'indisprimary'}) { $type = UNIQUE; #PRIMARY_KEY; #tell sqlt that this is the primary key: my $col_name=$column_names[($$indexhash{'indkey'} - 1)]; $table->get_field($col_name)->{is_primary_key}=1; } elsif ($$indexhash{'indisunique'}) { $type = UNIQUE; } else { $type = NORMAL; } my @column_ids = split /\s+/, $$indexhash{'indkey'}; my @columns = split /\s+/, $$indexhash{'attname'}; $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.11018/lib/SQL/Translator/Parser/YAML.pm0000644000175000017500000000707212143357340021044 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/xSV.pm0000644000175000017500000001133712143357340021021 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/Storable.pm0000644000175000017500000000204412143357340022047 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/MySQL.pm0000644000175000017500000010140112234455220021233 0ustar frewfrewpackage 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 WORD "$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 WORD(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, and you can escape the delmiters by doubling (but only the # delimiter) or by backslashing. /'(\\.|''|[^\\\'])*'/ | /"(\\.|""|[^\\\"])*"/ # For reference, std sql str: /(?:(?:\')(?:[^\']*(?:(?:\'\')[^\']*)*)(?:\'))// 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 WORD "$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 WORD { $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 /'.*?'/ { my $comment = $item[2]; $comment =~ s/^'//; $comment =~ s/'$//; $return = $comment; } 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 string { $item[2] =~ s/^\s*'|'\s*$//g or $item[2] =~ s/^\s*"|"\s*$//g; $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 WORD { $return = $item[3] } | /constraint/i NAME /foreign key/i { $return = $item[2] } | /constraint/i /foreign key/i { $return = '' } | /foreign key/i WORD { $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 /=/ /'.*?'/ { my $comment = $item[3]; $comment =~ s/^'//; $comment =~ s/'$//; $return = { comment => $comment }; } | /(default )?(charset|character set)/i /\s*=?\s*/ WORD { $return = { 'CHARACTER SET' => $item[3] }; } | /collate/i WORD { $return = { 'COLLATE' => $item[2] } } | /union/i /\s*=\s*/ '(' table_name(s /,/) ')' { $return = { $item[1] => $item[4] }; } | WORD /\s*=\s*/ MAYBE_QUOTED_WORD { $return = { $item[1] => $item[3] }; } MAYBE_QUOTED_WORD: /\w+/ | /'(\w+)'/ { $return = $1 } | /"(\w+)"/ { $return = $1 } 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 : BACKTICK /[^`]+/ BACKTICK { $item[2] } | DOUBLE_QUOTE /[^"]+/ DOUBLE_QUOTE { $item[2] } | SINGLE_QUOTE /[^']+/ SINGLE_QUOTE { $item[2] } NAME: QUOTED_NAME | /\w+/ VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ { $item[1] } | QUOTED_NAME { # remove leading/trailing quotes my $val = $item[1]; $val =~ s/^['"]|['"]$//g; $return = $val; } | /NULL/ { '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.11018/lib/SQL/Translator/Parser/SQLServer.pm0000644000175000017500000004006712143357340022131 0ustar frewfrewpackage 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 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 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 : WORD { $return = $item[1] } | LQUOTE WORD RQUOTE { $return = $item[2] } index_name : WORD { $return = $item[1] } | LQUOTE WORD RQUOTE { $return = $item[2] } table_name : WORD { $return = $item[1] } | LQUOTE WORD RQUOTE { $return = $item[2] } 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 /'[^']*'/ { $item[2]=~ s/'//g; $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 : QUOTE WORD '.' WORD QUOTE | LQUOTE WORD '.' WORD RQUOTE { $return = { owner => $item[2], name => $item[4] } } | LQUOTE WORD RQUOTE '.' LQUOTE WORD RQUOTE { $return = { owner => $item[2], name => $item[6] } } | LQUOTE WORD RQUOTE { $return = { name => $item[2] } } | WORD '.' WORD { $return = { owner => $item[1], name => $item[3] } } | WORD { $return = { name => $item[1] } } END_STATEMENT : ';' | GO GO : /^go/i NAME : QUOTE(?) /\w+/ QUOTE(?) { $item[2] } WORD : /[\w#]+/ DIGITS : /\d+/ COMMA : ',' QUOTE : /'/ LQUOTE : '[' RQUOTE : ']' 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.11018/lib/SQL/Translator/Parser/Oracle.pm0000644000175000017500000005160412143357340021507 0ustar frewfrewpackage 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 ) } # # 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, }; } eofile : /^\Z/ statement : remark | run | prompt | create | table_comment | comment_on_table | comment_on_column | alter | drop | alter : /alter/i WORD /[^;]+/ ';' { @table_comments = () } drop : /drop/i TABLE ';' drop : /drop/i 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_word_list { $item[1] } | '(' WORD parens_word_list ')' { my $arg_list = join(",", @{$item[3]}); $return = "$item[2]($arg_list)"; } 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_word_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] } field_meta : default_val | column_constraint default_val : /default/i /(?:')?[\w\d.-]*(?:')?/ { my $val = $item[2]; $val =~ s/'//g if defined $val; $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_word_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] } TABLE : /table/i VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ { $item[1] } | /'.*?'/ # XXX doesn't handle embedded quotes { $item[1] } | /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('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}, ); } 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.11018/lib/SQL/Translator/Parser/Sybase.pm0000644000175000017500000002470312143357340021530 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/DBI.pm0000644000175000017500000001025312143357340020673 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/JSON.pm0000755000175000017500000000713112234455220021047 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/Excel.pm0000644000175000017500000001345312143357340021342 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Parser/PostgreSQL.pm0000644000175000017500000007764212143357340022317 0ustar frewfrewpackage 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_with_opt_quotes(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_with_opt_quotes(s /,/) ';' { 1 } grant : /grant/i WORD(s /,/) /on/i TABLE(?) table_id /to/i name_with_opt_quotes(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_with_opt_quotes(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_with_opt_quotes 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' } comment_phrase : /'/ comment_phrase_unquoted(s) /'/ { my $phrase = join(' ', @{ $item[2] }); $return = $phrase} # [cjm TODO: double-single quotes in a comment_phrase] comment_phrase_unquoted : /[^\']*/ { $return = $item[1] } xxxcomment_phrase : /'.*?'|NULL/ { my $val = $item[1] || ''; $val =~ s/^'|'$//g; $return = $val; } 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_with_opt_quotes { $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_with_opt_quotes { $return = { schema_name => $item[1][0], table_name => $item[2] } } view_id : schema_qualification(?) name_with_opt_quotes { $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_with_opt_quotes '.' schema_name : name_with_opt_quotes field_name : name_with_opt_quotes name_with_opt_quotes : double_quote(?) NAME double_quote(?) { $item[2] } double_quote: /"/ index_name : name_with_opt_quotes data_type : pg_data_type parens_value_list(?) { my $data_type = $item[1]; # # We can deduce some sizes from the data type's name. # if ( my $size = $item[2][0] ) { $data_type->{'size'} = $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)/i { $return = { type => $item[1] }; } parens_value_list : '(' VALUE(s /,/) ')' { $item[2] } parens_word_list : '(' name_with_opt_quotes(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_with_opt_quotes(s /,/) ')' { $return = { type => 'primary_key', fields => $item[3], } } | /unique/i '(' name_with_opt_quotes(s /,/) ')' { $return = { type => 'unique', fields => $item[3], } } | /check/i '(' /[^)]+/ ')' { $return = { type => 'check', expression => $item[3], } } | /foreign key/i '(' name_with_opt_quotes(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 /(\d+|'[^']*'|\w+\(.*\))|\w+|\(\d+\)/ ( '::' data_type )(?) { my $val = defined $item[2] ? $item[2] : ''; $val =~ s/^'|'$//g; $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', } } 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_with_opt_quotes(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 : "`" /\w+/ "`" { $item[2] } | /\w+/ { $item[1] } | /[\$\w]+/ { $item[1] } VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ { $item[1] } | /'.*?'/ # XXX doesn't handle embedded quotes { $item[1] } | /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.11018/lib/SQL/Translator/Parser/XML/0000755000175000017500000000000012234461403020373 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Parser/XML/SQLFairy.pm0000644000175000017500000002360012234455220022364 0ustar frewfrewpackage 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 Schema::Field obj). =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.11018/lib/SQL/Translator/Parser/XML.pm0000644000175000017500000000100512143357340020730 0ustar frewfrewpackage 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.11018/lib/SQL/Translator/Diff.pm0000644000175000017500000004204412234455220017711 0ustar frewfrewpackage 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 =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 a hash. 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.11018/lib/SQL/Translator/Producer/0000755000175000017500000000000012234461403020262 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Producer/Storable.pm0000644000175000017500000000207412143357340022401 0ustar frewfrewpackage SQL::Translator::Producer::Storable; =head1 NAME SQL::Translator::Producer::Storable - serializes the SQL::Translator::Schema object via the Storable module =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new; $translator->producer('Storable'); =head1 DESCRIPTION This module uses Storable to serialize a schema to a string so that it can be saved to disk. Serializing a schema and then calling producers on the stored can realize significant performance gains when parsing takes a long time. =cut use strict; use warnings; our ( $DEBUG, @EXPORT_OK ); $DEBUG = 0 unless defined $DEBUG; our $VERSION = '1.59'; use Storable; use Exporter; use base qw(Exporter); @EXPORT_OK = qw(produce); sub produce { my $t = shift; my $args = $t->producer_args; my $schema = $t->schema; my $serialized = Storable::nfreeze($schema); return $serialized; } 1; =pod =head1 AUTHOR Paul Harrington Eharringp@deshaw.comE. =head1 SEE ALSO SQL::Translator, SQL::Translator::Schema, Storable. =cut SQL-Translator-0.11018/lib/SQL/Translator/Producer/SQLite.pm0000644000175000017500000003360512234455220021770 0ustar frewfrewpackage SQL::Translator::Producer::SQLite; =head1 NAME SQL::Translator::Producer::SQLite - SQLite producer for SQL::Translator =head1 SYNOPSIS use SQL::Translator; my $t = SQL::Translator->new( parser => '...', producer => 'SQLite' ); $t->translate; =head1 DESCRIPTION This module will produce text output of the schema suitable for SQLite. =cut use strict; use warnings; use Data::Dumper; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(debug header_comment parse_dbms_version); use SQL::Translator::Generator::DDL::SQLite; our ( $DEBUG, $WARN ); our $VERSION = '1.59'; $DEBUG = 0 unless defined $DEBUG; $WARN = 0 unless defined $WARN; our $max_id_length = 30; my %global_names; # HIDEOUS TEMPORARY DEFAULT WITHOUT QUOTING! our $NO_QUOTES = 1; { my ($quoting_generator, $nonquoting_generator); sub _generator { $NO_QUOTES ? $nonquoting_generator ||= SQL::Translator::Generator::DDL::SQLite->new(quote_chars => []) : $quoting_generator ||= SQL::Translator::Generator::DDL::SQLite->new } } sub produce { my $translator = shift; local $DEBUG = $translator->debug; local $WARN = $translator->show_warnings; my $no_comments = $translator->no_comments; my $add_drop_table = $translator->add_drop_table; my $schema = $translator->schema; my $producer_args = $translator->producer_args; my $sqlite_version = parse_dbms_version( $producer_args->{sqlite_version}, 'perl' ); my $no_txn = $producer_args->{no_transaction}; debug("PKG: Beginning production\n"); %global_names = (); #reset # only quote if quotes were requested for real # 0E0 indicates "the default of true" was assumed local $NO_QUOTES = 0 if $translator->quote_identifiers and $translator->quote_identifiers ne '0E0'; my $head = (header_comment() . "\n") unless $no_comments; my @create = (); push @create, "BEGIN TRANSACTION" unless $no_txn; for my $table ( $schema->get_tables ) { push @create, create_table($table, { no_comments => $no_comments, sqlite_version => $sqlite_version, add_drop_table => $add_drop_table,}); } for my $view ( $schema->get_views ) { push @create, create_view($view, { add_drop_view => $add_drop_table, no_comments => $no_comments, }); } for my $trigger ( $schema->get_triggers ) { push @create, create_trigger($trigger, { add_drop_trigger => $add_drop_table, no_comments => $no_comments, }); } push @create, "COMMIT" unless $no_txn; if (wantarray) { return ($head||(), @create); } else { return join ('', $head||(), join(";\n\n", @create ), ";\n", ); } } sub mk_name { my ($name, $scope, $critical) = @_; $scope ||= \%global_names; if ( my $prev = $scope->{ $name } ) { my $name_orig = $name; $name .= sprintf( "%02d", ++$prev ); substr($name, $max_id_length - 3) = "00" if length( $name ) > $max_id_length; warn "The name '$name_orig' has been changed to ", "'$name' to make it unique.\n" if $WARN; $scope->{ $name_orig }++; } $scope->{ $name }++; return _generator()->quote($name); } sub create_view { my ($view, $options) = @_; my $add_drop_view = $options->{add_drop_view}; my $view_name = _generator()->quote($view->name); $global_names{$view->name} = 1; debug("PKG: Looking at view '${view_name}'\n"); # Header. Should this look like what mysqldump produces? my $extra = $view->extra; my @create; push @create, "DROP VIEW IF EXISTS $view_name" if $add_drop_view; my $create_view = 'CREATE'; $create_view .= " TEMPORARY" if exists($extra->{temporary}) && $extra->{temporary}; $create_view .= ' VIEW'; $create_view .= " IF NOT EXISTS" if exists($extra->{if_not_exists}) && $extra->{if_not_exists}; $create_view .= " ${view_name}"; if( my $sql = $view->sql ){ $create_view .= " AS\n ${sql}"; } push @create, $create_view; # Tack the comment onto the first statement. unless ($options->{no_comments}) { $create[0] = "--\n-- View: ${view_name}\n--\n" . $create[0]; } return @create; } sub create_table { my ($table, $options) = @_; my $table_name = _generator()->quote($table->name); $global_names{$table->name} = 1; my $no_comments = $options->{no_comments}; my $add_drop_table = $options->{add_drop_table}; my $sqlite_version = $options->{sqlite_version} || 0; debug("PKG: Looking at table '$table_name'\n"); my ( @index_defs, @constraint_defs ); my @fields = $table->get_fields or die "No fields in $table_name"; my $temp = $options->{temporary_table} ? 'TEMPORARY ' : ''; # # Header. # my $exists = ($sqlite_version >= 3.003) ? ' IF EXISTS' : ''; my @create; my ($comment, $create_table) = ""; $comment = "--\n-- Table: $table_name\n--\n" unless $no_comments; if ($add_drop_table) { push @create, $comment . qq[DROP TABLE$exists $table_name]; } else { $create_table = $comment; } $create_table .= "CREATE ${temp}TABLE $table_name (\n"; # # Comments # if ( $table->comments and !$no_comments ){ $create_table .= "-- Comments: \n-- "; $create_table .= join "\n-- ", $table->comments; $create_table .= "\n--\n\n"; } # # How many fields in PK? # my $pk = $table->primary_key; my @pk_fields = $pk ? $pk->fields : (); # # Fields # my ( @field_defs, $pk_set ); for my $field ( @fields ) { push @field_defs, create_field($field); } if ( scalar @pk_fields > 1 || ( @pk_fields && !grep /INTEGER PRIMARY KEY/, @field_defs ) ) { push @field_defs, 'PRIMARY KEY (' . join(', ', map _generator()->quote($_), @pk_fields ) . ')'; } # # Indices # my $idx_name_default = 'A'; for my $index ( $table->get_indices ) { push @index_defs, create_index($index); } # # Constraints # my $c_name_default = 'A'; for my $c ( $table->get_constraints ) { if ($c->type eq "FOREIGN KEY") { push @field_defs, create_foreignkey($c); } next unless $c->type eq UNIQUE; push @constraint_defs, create_constraint($c); } $create_table .= join(",\n", map { " $_" } @field_defs ) . "\n)"; return (@create, $create_table, @index_defs, @constraint_defs ); } sub create_foreignkey { my $c = shift; my @fields = $c->fields; my @rfields = map { $_ || () } $c->reference_fields; unless ( @rfields ) { my $rtable_name = $c->reference_table; if ( my $ref_table = $c->schema->get_table( $rtable_name ) ) { push @rfields, $ref_table->primary_key; die "FK constraint on " . $rtable_name . '.' . join('', @fields) . " has no reference fields\n" unless @rfields; } else { die "Can't find reference table '$rtable_name' in schema\n"; } } my $fk_sql = sprintf 'FOREIGN KEY (%s) REFERENCES %s(%s)', join (', ', map { _generator()->quote($_) } @fields ), _generator()->quote($c->reference_table), join (', ', map { _generator()->quote($_) } @rfields ) ; $fk_sql .= " ON DELETE " . $c->{on_delete} if $c->{on_delete}; $fk_sql .= " ON UPDATE " . $c->{on_update} if $c->{on_update}; return $fk_sql; } sub create_field { return _generator()->field($_[0]) } sub create_index { my ($index, $options) = @_; my $name = $index->name; $name = mk_name($name); my $type = $index->type eq 'UNIQUE' ? "UNIQUE " : ''; # strip any field size qualifiers as SQLite doesn't like these my @fields = map { s/\(\d+\)$//; _generator()->quote($_) } $index->fields; (my $index_table_name = $index->table->name) =~ s/^.+?\.//; # table name may not specify schema $index_table_name = _generator()->quote($index_table_name); warn "removing schema name from '" . $index->table->name . "' to make '$index_table_name'\n" if $WARN; my $index_def = "CREATE ${type}INDEX $name ON " . $index_table_name . ' (' . join( ', ', @fields ) . ')'; return $index_def; } sub create_constraint { my ($c, $options) = @_; my $name = $c->name; $name = mk_name($name); my @fields = map _generator()->quote($_), $c->fields; (my $index_table_name = $c->table->name) =~ s/^.+?\.//; # table name may not specify schema $index_table_name = _generator()->quote($index_table_name); warn "removing schema name from '" . $c->table->name . "' to make '$index_table_name'\n" if $WARN; my $c_def = "CREATE UNIQUE INDEX $name ON " . $index_table_name . ' (' . join( ', ', @fields ) . ')'; return $c_def; } sub create_trigger { my ($trigger, $options) = @_; my $add_drop = $options->{add_drop_trigger}; my @statements; my $trigger_name = $trigger->name; $global_names{$trigger_name} = 1; my $events = $trigger->database_events; for my $evt ( @$events ) { my $trig_name = $trigger_name; if (@$events > 1) { $trig_name .= "_$evt"; warn "Multiple database events supplied for trigger '$trigger_name', ", "creating trigger '$trig_name' for the '$evt' event.\n" if $WARN; } $trig_name = _generator()->quote($trig_name); push @statements, "DROP TRIGGER IF EXISTS $trig_name" if $add_drop; $DB::single = 1; my $action = ""; if (not ref $trigger->action) { $action .= "BEGIN " . $trigger->action . " END"; } else { $action = $trigger->action->{for_each} . " " if $trigger->action->{for_each}; $action = $trigger->action->{when} . " " if $trigger->action->{when}; my $steps = $trigger->action->{steps} || []; $action .= "BEGIN "; $action .= $_ . "; " for (@$steps); $action .= "END"; } push @statements, sprintf ( 'CREATE TRIGGER %s %s %s on %s %s', $trig_name, $trigger->perform_action_when, $evt, _generator()->quote($trigger->on_table), $action ); } return @statements; } sub alter_table { } # Noop sub add_field { my ($field) = @_; return sprintf("ALTER TABLE %s ADD COLUMN %s", _generator()->quote($field->table->name), create_field($field)) } sub alter_create_index { my ($index) = @_; # This might cause name collisions return create_index($index); } sub alter_create_constraint { my ($constraint) = @_; return create_constraint($constraint) if $constraint->type eq 'UNIQUE'; } sub alter_drop_constraint { alter_drop_index(@_) } sub alter_drop_index { my ($constraint) = @_; return sprintf("DROP INDEX %s", _generator()->quote($constraint->name)); } sub batch_alter_table { my ($table, $diffs) = @_; # If we have any of the following # # rename_field # alter_field # drop_field # # we need to do the following # # BEGIN TRANSACTION; # CREATE TEMPORARY TABLE t1_backup(a,b); # INSERT INTO t1_backup SELECT a,b FROM t1; # DROP TABLE t1; # CREATE TABLE t1(a,b); # INSERT INTO t1 SELECT a,b FROM t1_backup; # DROP TABLE t1_backup; # COMMIT; # # Fun, eh? # # If we have rename_field we do similarly. my $table_name = $table->name; my $renaming = $diffs->{rename_table} && @{$diffs->{rename_table}}; if ( @{$diffs->{rename_field}} == 0 && @{$diffs->{alter_field}} == 0 && @{$diffs->{drop_field}} == 0 ) { # return join("\n", map { return map { my $meth = __PACKAGE__->can($_) or die __PACKAGE__ . " cant $_"; map { my $sql = $meth->(ref $_ eq 'ARRAY' ? @$_ : $_); $sql ? ("$sql") : () } @{ $diffs->{$_} } } grep { @{$diffs->{$_}} } 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/; } my @sql; my $old_table = $renaming ? $diffs->{rename_table}[0][0] : $table; if(@{$diffs->{drop_field}}) { $old_table =$diffs->{drop_field}[0]->table; } my %temp_table_fields; do { local $table->{name} = $table_name . '_temp_alter'; # We only want the table - don't care about indexes on tmp table my ($table_sql) = create_table($table, {no_comments => 1, temporary_table => 1}); push @sql,$table_sql; %temp_table_fields = map { $_ => 1} $table->get_fields; }; push @sql, "INSERT INTO @{[_generator()->quote($table_name.'_temp_alter')]}( @{[ join(', ', map _generator()->quote($_), grep { $temp_table_fields{$_} } $old_table->get_fields)]}) SELECT @{[ join(', ', map _generator()->quote($_), grep { $temp_table_fields{$_} } $old_table->get_fields)]} FROM @{[_generator()->quote($old_table)]}", "DROP TABLE @{[_generator()->quote($old_table)]}", create_table($table, { no_comments => 1 }), "INSERT INTO @{[_generator()->quote($table_name)]} SELECT @{[ join(', ', map _generator()->quote($_), $table->get_fields)]} FROM @{[_generator()->quote($table_name.'_temp_alter')]}", "DROP TABLE @{[_generator()->quote($table_name.'_temp_alter')]}"; return @sql; # return join("", @sql, ""); } sub drop_table { my ($table) = @_; $table = _generator()->quote($table); return "DROP TABLE $table"; } sub rename_table { my ($old_table, $new_table, $options) = @_; $old_table = _generator()->quote($old_table); $new_table = _generator()->quote($new_table); return "ALTER TABLE $old_table RENAME TO $new_table"; } # No-op. Just here to signify that we are a new style parser. sub preproces_schema { } 1; =pod =head1 SEE ALSO SQL::Translator, http://www.sqlite.org/. =head1 AUTHOR Ken Youens-Clark C<< >>. Diff code added by Ash Berlin C<< >>. =cut SQL-Translator-0.11018/lib/SQL/Translator/Producer/DB2.pm0000644000175000017500000003437712143357340021210 0ustar frewfrewpackage SQL::Translator::Producer::DB2; =head1 NAME SQL::Translator::Producer::DB2 - DB2 SQL producer =head1 SYNOPSIS use SQL::Translator; my $t = SQL::Translator->new( parser => '...', producer => 'DB2' ); print $translator->translate( $file ); =head1 DESCRIPTION Creates an SQL DDL suitable for DB2. =cut use warnings; use strict; use warnings; our ( $DEBUG, $WARN ); our $VERSION = '1.59'; $DEBUG = 0 unless defined $DEBUG; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(header_comment); # http://publib.boulder.ibm.com/infocenter/db2help/topic/com.ibm.db2.udb.doc/ad/r0006844.htm # This is a terrible WTDI, each Parser should parse down to some standard set # of SQL data types, with field->extra entries being used to convert back to # weird types like "polygon" if needed (IMO anyway) my %dt_translate; BEGIN { %dt_translate = ( # # MySQL types # int => 'integer', mediumint => 'integer', tinyint => 'smallint', char => 'char', tinyblob => 'blob', mediumblob => 'blob', longblob => 'long varchar for bit data', tinytext => 'varchar', text => 'varchar', longtext => 'varchar', mediumtext => 'varchar', enum => 'varchar', set => 'varchar', date => 'date', datetime => 'timestamp', time => 'time', year => 'date', # # PostgreSQL types # 'double precision' => 'double', serial => 'integer', bigserial => 'integer', money => 'double', character => 'char', 'character varying' => 'varchar', bytea => 'BLOB', interval => 'integer', boolean => 'smallint', point => 'integer', line => 'integer', lseg => 'integer', box => 'integer', path => 'integer', polygon => 'integer', circle => 'integer', cidr => 'integer', inet => 'varchar', macaddr => 'varchar', bit => 'number', 'bit varying' => 'number', # # DB types # number => 'integer', varchar2 => 'varchar', long => 'clob', ); } my %db2_reserved = map { $_ => 1} qw/ ADD DETERMINISTIC LEAVE RESTART AFTER DISALLOW LEFT RESTRICT ALIAS DISCONNECT LIKE RESULT ALL DISTINCT LINKTYPE RESULT_SET_LOCATOR ALLOCATE DO LOCAL RETURN ALLOW DOUBLE LOCALE RETURNS ALTER DROP LOCATOR REVOKE AND DSNHATTR LOCATORS RIGHT ANY DSSIZE LOCK ROLLBACK APPLICATION DYNAMIC LOCKMAX ROUTINE AS EACH LOCKSIZE ROW ASSOCIATE EDITPROC LONG ROWS ASUTIME ELSE LOOP RRN AUDIT ELSEIF MAXVALUE RUN AUTHORIZATION ENCODING MICROSECOND SAVEPOINT AUX END MICROSECONDS SCHEMA AUXILIARY END-EXEC MINUTE SCRATCHPAD BEFORE END-EXEC1 MINUTES SECOND BEGIN ERASE MINVALUE SECONDS BETWEEN ESCAPE MODE SECQTY BINARY EXCEPT MODIFIES SECURITY BUFFERPOOL EXCEPTION MONTH SELECT BY EXCLUDING MONTHS SENSITIVE CACHE EXECUTE NEW SET CALL EXISTS NEW_TABLE SIGNAL CALLED EXIT NO SIMPLE CAPTURE EXTERNAL NOCACHE SOME CARDINALITY FENCED NOCYCLE SOURCE CASCADED FETCH NODENAME SPECIFIC CASE FIELDPROC NODENUMBER SQL CAST FILE NOMAXVALUE SQLID CCSID FINAL NOMINVALUE STANDARD CHAR FOR NOORDER START CHARACTER FOREIGN NOT STATIC CHECK FREE NULL STAY CLOSE FROM NULLS STOGROUP CLUSTER FULL NUMPARTS STORES COLLECTION FUNCTION OBID STYLE COLLID GENERAL OF SUBPAGES COLUMN GENERATED OLD SUBSTRING COMMENT GET OLD_TABLE SYNONYM COMMIT GLOBAL ON SYSFUN CONCAT GO OPEN SYSIBM CONDITION GOTO OPTIMIZATION SYSPROC CONNECT GRANT OPTIMIZE SYSTEM CONNECTION GRAPHIC OPTION TABLE CONSTRAINT GROUP OR TABLESPACE CONTAINS HANDLER ORDER THEN CONTINUE HAVING OUT TO COUNT HOLD OUTER TRANSACTION COUNT_BIG HOUR OVERRIDING TRIGGER CREATE HOURS PACKAGE TRIM CROSS IDENTITY PARAMETER TYPE CURRENT IF PART UNDO CURRENT_DATE IMMEDIATE PARTITION UNION CURRENT_LC_CTYPE IN PATH UNIQUE CURRENT_PATH INCLUDING PIECESIZE UNTIL CURRENT_SERVER INCREMENT PLAN UPDATE CURRENT_TIME INDEX POSITION USAGE CURRENT_TIMESTAMP INDICATOR PRECISION USER CURRENT_TIMEZONE INHERIT PREPARE USING CURRENT_USER INNER PRIMARY VALIDPROC CURSOR INOUT PRIQTY VALUES CYCLE INSENSITIVE PRIVILEGES VARIABLE DATA INSERT PROCEDURE VARIANT DATABASE INTEGRITY PROGRAM VCAT DAY INTO PSID VIEW DAYS IS QUERYNO VOLUMES DB2GENERAL ISOBID READ WHEN DB2GENRL ISOLATION READS WHERE DB2SQL ITERATE RECOVERY WHILE DBINFO JAR REFERENCES WITH DECLARE JAVA REFERENCING WLM DEFAULT JOIN RELEASE WRITE DEFAULTS KEY RENAME YEAR DEFINITION LABEL REPEAT YEARS DELETE LANGUAGE RESET DESCRIPTOR LC_CTYPE RESIGNAL /; sub produce { my ($translator) = @_; $DEBUG = $translator->debug; $WARN = $translator->show_warnings; my $no_comments = $translator->no_comments; my $add_drop_table = $translator->add_drop_table; my $schema = $translator->schema; my $output = ''; my $indent = ' '; $output .= header_comment unless($no_comments); my (@table_defs, @fks, @index_defs); foreach my $table ($schema->get_tables) { push @table_defs, 'DROP TABLE ' . $table->name . ";" if $add_drop_table; my ($table_def, $fks) = create_table($table, { no_comments => $no_comments}); push @table_defs, $table_def; push @fks, @$fks; foreach my $index ($table->get_indices) { push @index_defs, create_index($index); } } my (@view_defs); foreach my $view ( $schema->get_views ) { push @view_defs, create_view($view); } my (@trigger_defs); foreach my $trigger ( $schema->get_triggers ) { push @trigger_defs, create_trigger($trigger); } return wantarray ? (@table_defs, @fks, @index_defs, @view_defs, @trigger_defs) : $output . join("\n\n", @table_defs, @fks, @index_defs, @view_defs, @trigger_defs) . "\n"; } { my %objnames; sub check_name { my ($name, $type, $length) = @_; my $newname = $name; if(length($name) > $length) ## Maximum table name length is 18 { warn "Table name $name is longer than $length characters, truncated" if $WARN; # if(grep {$_ eq substr($name, 0, $length) } # values(%{$objnames{$type}})) # { # die "Got multiple matching table names when truncated"; # } # $objnames{$type}{$name} = substr($name, 0,$length); # $newname = $objnames{$type}{$name}; } if($db2_reserved{uc($newname)}) { warn "$newname is a reserved word in DB2!" if $WARN; } # return sprintf("%-*s", $length-5, $newname); return $newname; } } sub create_table { my ($table, $options) = @_; my $table_name = check_name($table->name, 'tables', 128); # this limit is 18 in older DB2s ! (<= 8) my (@field_defs, @comments); push @comments, "--\n-- Table: $table_name\n--" unless $options->{no_comments}; foreach my $field ($table->get_fields) { push @field_defs, create_field($field); } my (@con_defs, @fks); foreach my $con ($table->get_constraints) { my ($cdefs, $fks) = create_constraint($con); push @con_defs, @$cdefs; push @fks, @$fks; } my $tablespace = $table->extra()->{'TABLESPACE'} || ''; my $table_def = "CREATE TABLE $table_name (\n"; $table_def .= join (",\n", map { " $_" } @field_defs, @con_defs); $table_def .= "\n)"; $table_def .= $tablespace ? "IN $tablespace;" : ';'; return $table_def, \@fks; } sub create_field { my ($field) = @_; my $field_name = check_name($field->name, 'fields', 30); # use Data::Dumper; # print Dumper(\%dt_translate); # print $field->data_type, " ", $dt_translate{lc($field->data_type)}, "\n"; my $data_type = uc($dt_translate{lc($field->data_type)} || $field->data_type); my $size = $field->size(); my $field_def = "$field_name $data_type"; $field_def .= $field->is_auto_increment ? ' GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1)' : ''; $field_def .= $data_type =~ /(CHAR|CLOB|NUMERIC|DECIMAL)/i ? "(${size})" : ''; $field_def .= !$field->is_nullable ? ' NOT NULL':''; # $field_def .= $field->is_primary_key ? ' PRIMARY KEY':''; $field_def .= !defined $field->default_value ? '' : $field->default_value =~ /current( |_)timestamp/i || $field->default_value =~ /\Qnow()\E/i ? ' DEFAULT CURRENT TIMESTAMP' : defined $field->default_value ? (" DEFAULT " . ($data_type =~ /(INT|DOUBLE)/i ? $field->default_value : "'" . $field->default_value . "'") ) : ''; return $field_def; } sub create_index { my ($index) = @_; my $out = sprintf('CREATE %sINDEX %s ON %s ( %s );', $index->type() =~ /^UNIQUE$/i ? 'UNIQUE' : '', $index->name, $index->table->name, join(', ', $index->fields) ); return $out; } sub create_constraint { my ($constraint) = @_; my (@con_defs, @fks); my $ctype = $constraint->type =~ /^PRIMARY(_|\s)KEY$/i ? 'PRIMARY KEY' : $constraint->type =~ /^UNIQUE$/i ? 'UNIQUE' : $constraint->type =~ /^CHECK_C$/i ? 'CHECK' : $constraint->type =~ /^FOREIGN(_|\s)KEY$/i ? 'FOREIGN KEY' : ''; my $expr = $constraint->type =~ /^CHECK_C$/i ? $constraint->expression : ''; my $ref = $constraint->type =~ /^FOREIGN(_|\s)KEY$/i ? ('REFERENCES ' . $constraint->reference_table . '(' . join(', ', $constraint->reference_fields) . ')') : ''; my $update = $constraint->on_update ? $constraint->on_update : ''; my $delete = $constraint->on_delete ? $constraint->on_delete : ''; my $out = join(' ', grep { $_ } $constraint->name ? ('CONSTRAINT ' . $constraint->name) : '', $ctype, '(' . join (', ', $constraint->fields) . ')', $expr ? $expr : $ref, $update, $delete); if ($constraint->type eq FOREIGN_KEY) { my $table_name = $constraint->table->name; $out = "ALTER TABLE $table_name ADD $out;"; push @fks, $out; } else { push @con_defs, $out; } return \@con_defs, \@fks; } sub create_view { my ($view) = @_; my $out = sprintf("CREATE VIEW %s AS\n%s;", $view->name, $view->sql); return $out; } sub create_trigger { my ($trigger) = @_; # create: CREATE TRIGGER trigger_name before type /ON/i table_name reference_b(?) /FOR EACH ROW/i 'MODE DB2SQL' triggered_action my $db_events = join ', ', $trigger->database_events; my $out = sprintf('CREATE TRIGGER %s %s %s ON %s %s %s MODE DB2SQL %s', $trigger->name, $trigger->perform_action_when || 'AFTER', $db_events =~ /update_on/i ? ('UPDATE OF '. join(', ', $trigger->fields)) : $db_events || 'UPDATE', $trigger->table->name, $trigger->extra->{reference} || 'REFERENCING OLD AS oldrow NEW AS newrow', $trigger->extra->{granularity} || 'FOR EACH ROW', $trigger->action ); return $out; } sub alter_field { my ($from_field, $to_field) = @_; my $data_type = uc($dt_translate{lc($to_field->data_type)} || $to_field->data_type); my $size = $to_field->size(); $data_type .= $data_type =~ /CHAR/i ? "(${size})" : ''; # DB2 will only allow changing of varchar/vargraphic datatypes # to extend their lengths. Or changing of text types to other # texttypes, and numeric types to larger numeric types. (v8) # We can also drop/add keys, checks and constraints, but not # columns !? my $out = sprintf('ALTER TABLE %s ALTER %s SET DATATYPE %s', $to_field->table->name, $to_field->name, $data_type); } sub add_field { my ($new_field) = @_; my $out = sprintf('ALTER TABLE %s ADD COLUMN %s', $new_field->table->name, create_field($new_field)); return $out; } sub drop_field { my ($field) = @_; return ''; } 1; SQL-Translator-0.11018/lib/SQL/Translator/Producer/GraphViz.pm0000644000175000017500000004540212234455220022357 0ustar frewfrewpackage SQL::Translator::Producer::GraphViz; =pod =head1 NAME SQL::Translator::Producer::GraphViz - GraphViz producer for SQL::Translator =head1 SYNOPSIS use SQL::Translator; my $trans = SQL::Translator->new( from => 'MySQL', # or your db of choice to => 'GraphViz', producer_args => { out_file => 'schema.png', bgcolor => 'lightgoldenrodyellow', show_constraints => 1, show_datatypes => 1, show_sizes => 1 } ) or die SQL::Translator->error; $trans->translate or die $trans->error; =head1 DESCRIPTION Creates a graph of a schema using the amazing graphviz (see http://www.graphviz.org/) application (via the L module). It's nifty--you should try it! =head1 PRODUCER ARGS All L constructor attributes are accepted and passed through to L. The following defaults are assumed for some attributes: layout => 'dot', overlap => 'false', node => { shape => 'record', style => 'filled', fillcolor => 'white', }, # in inches width => 8.5, height => 11, See the documentation of L for more info on these and other attributes. In addition this producer accepts the following arguments: =over 4 =item * skip_tables An arrayref or a comma-separated list of table names that should be skipped. Note that a skipped table node may still appear if another table has foreign key constraints pointing to the skipped table. If this happens no table field/index information will be included. =item * skip_tables_like An arrayref or a comma-separated list of regular expressions matching table names that should be skipped. =item * cluster Clustering of tables allows you to group and box tables according to function or domain or whatever criteria you choose. The syntax for clustering tables is: cluster => 'cluster1=table1,table2;cluster2=table3,table4' Or pass it as an arrayref like so: cluster => [ 'cluster1=table1,table2', 'cluster2=table3,table4' ] Or like so: cluster => [ { name => 'cluster1', tables => [ 'table1', 'table2' ] }, { name => 'cluster2', tables => [ 'table3', 'table4' ] }, ] =item * out_file The name of the file where the resulting GraphViz output will be written. Alternatively an open filehandle can be supplied. If undefined (the default) - the result is returned as a string. =item * output_type (DEFAULT: 'png') This determines which L will be invoked to generate the graph: C translates to C, C to C and so on. =item * fontname This sets the global font name (or full path to font file) for node, edge, and graph labels =item * fontsize This sets the global font size for node and edge labels (note that arbitrarily large sizes may be ignored due to page size or graph size constraints) =item * show_fields (DEFAULT: true) If set to a true value, the names of the columns in a table will be displayed in each table's node =item * show_fk_only If set to a true value, only columns which are foreign keys will be displayed in each table's node =item * show_datatypes If set to a true value, the datatype of each column will be displayed next to each column's name; this option will have no effect if the value of C is set to false =item * friendly_ints If set to a true value, each integer type field will be displayed as a tinyint, smallint, integer or bigint depending on the field's associated size parameter. This only applies for the C type (and not the C type, which is always assumed to be a 32-bit integer); this option will have no effect if the value of C is set to false =item * friendly_ints_extended If set to a true value, the friendly ints displayed will take into account the non-standard types, 'tinyint' and 'mediumint' (which, as far as I am aware, is only implemented in MySQL) =item * show_sizes If set to a true value, the size (in bytes) of each CHAR and VARCHAR column will be displayed in parentheses next to the column's name; this option will have no effect if the value of C is set to false =item * show_constraints If set to a true value, a field's constraints (i.e., its primary-key-ness, its foreign-key-ness and/or its uniqueness) will appear as a comma-separated list in brackets next to the field's name; this option will have no effect if the value of C is set to false =item * show_indexes If set to a true value, each record will also show the indexes set on each table. It describes the index types along with which columns are included in the index. =item * show_index_names (DEFAULT: true) If C is set to a true value, then the value of this parameter determines whether or not to print names of indexes. if C is false, then a list of indexed columns will appear below the field list. Otherwise, it will be a list prefixed with the name of each index. =item * natural_join If set to a true value, L will be called before generating the graph. =item * join_pk_only The value of this option will be passed as the value of the like-named argument to L; implies C<< natural_join => 1 >> =item * skip_fields The value of this option will be passed as the value of the like-named argument to L; implies C<< natural_join => 1 >> =back =head2 DEPRECATED ARGS =over 4 =item * node_shape Deprecated, use node => { shape => ... } instead =item * add_color Deprecated, use bgcolor => 'lightgoldenrodyellow' instead If set to a true value, the graphic will have a background color of 'lightgoldenrodyellow'; otherwise the default white background will be used =item * nodeattrs Deprecated, use node => { ... } instead =item * edgeattrs Deprecated, use edge => { ... } instead =item * graphattrs Deprecated, use graph => { ... } instead =back =cut use warnings; use strict; use GraphViz; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(debug); use Scalar::Util qw/openhandle/; our $DEBUG; our $VERSION = '1.59'; $DEBUG = 0 unless defined $DEBUG; sub produce { my $t = shift; my $schema = $t->schema; my $args = $t->producer_args; local $DEBUG = $t->debug; # translate legacy {node|edge|graph}attrs to just {node|edge|graph} for my $argtype (qw/node edge graph/) { my $old_arg = $argtype . 'attrs'; my %arglist = (map { %{ $_ || {} } } ( delete $args->{$old_arg}, delete $args->{$argtype} ) ); $args->{$argtype} = \%arglist if keys %arglist; } # explode font settings for (qw/fontsize fontname/) { if (defined $args->{$_}) { $args->{node}{$_} ||= $args->{$_}; $args->{edge}{$_} ||= $args->{$_}; $args->{graph}{$_} ||= $args->{$_}; } } # legacy add_color setting, trumped by bgcolor if set $args->{bgcolor} ||= 'lightgoldenrodyellow' if $args->{add_color}; # legacy node_shape setting, defaults to 'record', trumped by {node}{shape} $args->{node}{shape} ||= ( $args->{node_shape} || 'record' ); # maintain defaults $args->{layout} ||= 'dot'; $args->{output_type} ||= 'png'; $args->{overlap} ||= 'false'; $args->{node}{style} ||= 'filled'; $args->{node}{fillcolor} ||= 'white'; $args->{show_fields} = 1 if not exists $args->{show_fields}; $args->{show_index_names} = 1 if not exists $args->{show_index_names}; $args->{width} = 8.5 if not defined $args->{width}; $args->{height} = 11 if not defined $args->{height}; for ( $args->{height}, $args->{width} ) { $_ = 0 unless $_ =~ /^\d+(?:.\d+)?$/; $_ = 0 if $_ < 0; } # so split won't warn $args->{$_} ||= '' for qw/skip_fields skip_tables skip_tables_like cluster/; my %skip_fields = map { s/^\s+|\s+$//g; length $_ ? ($_, 1) : () } split ( /,/, $args->{skip_fields} ); my %skip_tables = map { $_, 1 } ( ref $args->{skip_tables} eq 'ARRAY' ? @{$args->{skip_tables}} : split (/\s*,\s*/, $args->{skip_tables}) ); my @skip_tables_like = map { qr/$_/ } ( ref $args->{skip_tables_like} eq 'ARRAY' ? @{$args->{skip_tables_like}} : split (/\s*,\s*/, $args->{skip_tables_like}) ); # join_pk_only/skip_fields implies natural_join $args->{natural_join} = 1 if ($args->{join_pk_only} or scalar keys %skip_fields); # usually we do not want direction when using natural join $args->{directed} = ($args->{natural_join} ? 0 : 1) if not exists $args->{directed}; $schema->make_natural_joins( join_pk_only => $args->{join_pk_only}, skip_fields => $args->{skip_fields}, ) if $args->{natural_join}; my %cluster; if ( defined $args->{'cluster'} ) { my @clusters; if ( ref $args->{'cluster'} eq 'ARRAY' ) { @clusters = @{ $args->{'cluster'} }; } else { @clusters = split /\s*;\s*/, $args->{'cluster'}; } for my $c ( @clusters ) { my ( $cluster_name, @cluster_tables ); if ( ref $c eq 'HASH' ) { $cluster_name = $c->{'name'} || $c->{'cluster_name'}; @cluster_tables = @{ $c->{'tables'} || [] }; } else { my ( $name, $tables ) = split /\s*=\s*/, $c; $cluster_name = $name; @cluster_tables = split /\s*,\s*/, $tables; } for my $table ( @cluster_tables ) { $cluster{ $table } = $cluster_name; } } } # # Create a blank GraphViz object and see if we can produce the output type. # my $gv = GraphViz->new( %$args ) or die sprintf ("Can't create GraphViz object: %s\n", $@ || 'reason unknown' ); my $output_method = "as_$args->{output_type}"; # the generators are AUTOLOADed so can't use ->can ($output_method) eval { $gv->$output_method }; die "Invalid output type: '$args->{output_type}'" if $@; # # Process tables definitions, create nodes # my %nj_registry; # for locations of fields for natural joins my @fk_registry; # for locations of fields for foreign keys TABLE: for my $table ( $schema->get_tables ) { my $table_name = $table->name; if ( @skip_tables_like or keys %skip_tables ) { next TABLE if $skip_tables{ $table_name }; for my $regex ( @skip_tables_like ) { next TABLE if $table_name =~ $regex; } } my @fields = $table->get_fields; if ( $args->{show_fk_only} ) { @fields = grep { $_->is_foreign_key } @fields; } my $field_str = ''; if ($args->{show_fields}) { my @fmt_fields; for my $field (@fields) { my $field_info; if ($args->{show_datatypes}) { my $field_type = $field->data_type; my $size = $field->size; if ( $args->{friendly_ints} && $size && (lc ($field_type) eq 'integer') ) { # Automatically translate to int2, int4, int8 # Type (Bits) Max. Signed/Unsigned Length # tinyint* (8) 128 3 # 255 3 # smallint (16) 32767 5 # 65535 5 # mediumint* (24) 8388607 7 # 16777215 8 # int (32) 2147483647 10 # 4294967295 11 # bigint (64) 9223372036854775807 19 # 18446744073709551615 20 # # * tinyint and mediumint are nonstandard extensions which are # only available under MySQL (to my knowledge) if ($size <= 3 and $args->{friendly_ints_extended}) { $field_type = 'tinyint'; } elsif ($size <= 5) { $field_type = 'smallint'; } elsif ($size <= 8 and $args->{friendly_ints_extended}) { $field_type = 'mediumint'; } elsif ($size <= 11) { $field_type = 'integer'; } else { $field_type = 'bigint'; } } $field_info = $field_type; if ($args->{show_sizes} && $size && ($field_type =~ /^ (?: NUMERIC | DECIMAL | (VAR)?CHAR2? ) $/ix ) ) { $field_info .= '(' . $size . ')'; } } my $constraints; if ($args->{show_constraints}) { my @constraints; push(@constraints, $field->is_auto_increment ? 'PA' : 'PK') if $field->is_primary_key; push(@constraints, 'FK') if $field->is_foreign_key; push(@constraints, 'U') if $field->is_unique; push(@constraints, 'N') if $field->is_nullable; $constraints = join (',', @constraints); } # construct the field line from all info gathered so far push @fmt_fields, join (' ', '-', $field->name, $field_info || (), $constraints ? "[$constraints]" : (), ); } # join field lines with graphviz formatting $field_str = join ('\l', @fmt_fields) . '\l'; } my $index_str = ''; if ($args->{show_indexes}) { my @fmt_indexes; for my $index ($table->get_indices) { next unless $index->is_valid; push @fmt_indexes, join (' ', '*', $args->{show_index_names} ? $index->name . ':' : () , join (', ', $index->fields), ($index->type eq 'UNIQUE') ? '[U]' : (), ); } # join index lines with graphviz formatting (if any indexes at all) $index_str = join ('\l', @fmt_indexes) . '\l' if @fmt_indexes; } my $name_str = $table_name . '\n'; # escape spaces for ($name_str, $field_str, $index_str) { $_ =~ s/ /\\ /g; } my $node_args; # only the 'record' type supports nice formatting if ($args->{node}{shape} eq 'record') { # the necessity to supply shape => 'record' is a graphviz bug $node_args = { shape => 'record', label => sprintf ('{%s}', join ('|', $name_str, $field_str || (), $index_str || (), ), ), }; } else { my $sep = sprintf ('%s\n', '-' x ( (length $table_name) + 2) ); $node_args = { label => join ($sep, $name_str, $field_str || (), $index_str || (), ), }; } if (my $cluster_name = $cluster{$table_name} ) { $node_args->{cluster} = $cluster_name; } $gv->add_node(qq["$table_name"], %$node_args); debug("Processing table '$table_name'"); debug("Fields = ", join(', ', map { $_->name } @fields)); for my $f ( @fields ) { my $name = $f->name or next; my $is_pk = $f->is_primary_key; my $is_unique = $f->is_unique; # # Decide if we should skip this field. # if ( $args->{natural_join} ) { next unless $is_pk || $f->is_foreign_key; } my $constraints = $f->{'constraints'}; if ( $args->{natural_join} && !$skip_fields{ $name } ) { push @{ $nj_registry{ $name } }, $table_name; } } unless ( $args->{natural_join} ) { for my $c ( $table->get_constraints ) { next unless $c->type eq FOREIGN_KEY; my $fk_table = $c->reference_table or next; for my $field_name ( $c->fields ) { for my $fk_field ( $c->reference_fields ) { next unless defined $schema->get_table( $fk_table ); # a condition is optional if at least one fk is nullable push @fk_registry, [ $table_name, $fk_table, scalar (grep { $_->is_nullable } ($c->fields)) ]; } } } } } # # Process relationships, create edges # my (@table_bunches, %optional_constraints); if ( $args->{natural_join} ) { for my $field_name ( keys %nj_registry ) { my @table_names = @{ $nj_registry{ $field_name } || [] } or next; next if scalar @table_names == 1; push @table_bunches, [ @table_names ]; } } else { for my $i (0 .. $#fk_registry) { my $fk = $fk_registry[$i]; push @table_bunches, [$fk->[0], $fk->[1]]; $optional_constraints{$i} = $fk->[2]; } } my %done; for my $bi (0 .. $#table_bunches) { my @tables = @{$table_bunches[$bi]}; for my $i ( 0 .. $#tables ) { my $table1 = $tables[ $i ]; for my $j ( 1 .. $#tables ) { next if $i == $j; my $table2 = $tables[ $j ]; next if $done{ $table1 }{ $table2 }; debug("Adding edge '$table2' -> '$table1'"); $gv->add_edge( qq["$table2"], qq["$table1"], arrowhead => $optional_constraints{$bi} ? 'empty' : 'normal', ); $done{ $table1 }{ $table2 } = 1; } } } # # Print the image # if ( my $out = $args->{out_file} ) { if (openhandle ($out)) { print $out $gv->$output_method; } else { open my $fh, '>', $out or die "Can't write '$out': $!\n"; binmode $fh; print $fh $gv->$output_method; close $fh; } } else { return $gv->$output_method; } } 1; =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE Jonathan Yu Efrequency@cpan.orgE =head1 SEE ALSO SQL::Translator, GraphViz =cut SQL-Translator-0.11018/lib/SQL/Translator/Producer/Dumper.pm0000644000175000017500000001746612143357340022075 0ustar frewfrewpackage SQL::Translator::Producer::Dumper; =head1 NAME SQL::Translator::Producer::Dumper - SQL Dumper producer for SQL::Translator =head1 SYNOPSIS use SQL::Translator::Producer::Dumper; Options: db_user Database username db_password Database password dsn DSN for DBI mysql_loadfile Create MySQL's LOAD FILE syntax instead of INSERTs skip=t1[,t2] Skip tables in comma-separated list skiplike=regex Skip tables in comma-separated list =head1 DESCRIPTION This producer creates a Perl script that can connect to a database and dump the data as INSERT statements (a la mysqldump) or as a file suitable for MySQL's LOAD DATA command. If you enable "add-truncate" or specify tables to "skip" (also using the "skiplike" regular expression) then the generated dumper script will leave out those tables. However, these will also be options in the generated dumper, so you can wait to specify these options when you dump your database. The database username, password, and DSN can be hardcoded into the generated script, or part of the DSN can be intuited from the "database" argument. =cut use strict; use warnings; use Config; use SQL::Translator; use File::Temp 'tempfile'; use Template; use Data::Dumper; our $VERSION = '1.59'; sub produce { my $t = shift; my $args = $t->producer_args; my $schema = $t->schema; my $add_truncate = $args->{'add_truncate'} || 0; my $skip = $args->{'skip'} || ''; my $skiplike = $args->{'skiplike'} || ''; my $db_user = $args->{'db_user'} || 'db_user'; my $db_pass = $args->{'db_password'} || 'db_pass'; my $parser_name = $t->parser_type; my %skip = map { $_, 1 } map { s/^\s+|\s+$//; $_ } split (/,/, $skip); my $sqlt_version = $t->version; if ( $parser_name =~ /Parser::(\w+)$/ ) { $parser_name = $1 } my %type_to_dbd = ( MySQL => 'mysql', Oracle => 'Oracle', PostgreSQL => 'Pg', SQLite => 'SQLite', Sybase => 'Sybase', ); my $dbd = $type_to_dbd{ $parser_name } || 'DBD'; my $dsn = $args->{'dsn'} || "dbi:$dbd:"; if ( $dbd eq 'Pg' && ! $args->{'dsn'} ) { $dsn .= 'dbname=dbname;host=hostname'; } elsif ( $dbd eq 'Oracle' && ! $args->{'dsn'} ) { $db_user = "$db_user/$db_pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)" . "(HOST=hostname)(PORT=1521))(CONNECT_DATA=(SID=sid)))"; $db_pass = ''; } elsif ( $dbd eq 'mysql' && ! $args->{'dsn'} ) { $dsn .= 'dbname'; } my $template = Template->new; my $template_text = template(); my $out; $template->process( \$template_text, { translator => $t, schema => $schema, db_user => $db_user, db_pass => $db_pass, dsn => $dsn, perl => $Config{'startperl'}, skip => \%skip, skiplike => $skiplike, }, \$out ) or die $template->error; return $out; } sub template { # # Returns the template to be processed by Template Toolkit # return <<'EOF'; [% perl || '#!/usr/bin/perl' %] [% USE date %] # # Generated by SQL::Translator [% translator.version %] # [% date.format( date.now, "%Y-%m-%d" ) %] # For more info, see http://sqlfairy.sourceforge.net/ # use strict; use Cwd; use DBI; use Getopt::Long; use File::Spec::Functions 'catfile'; my ( $help, $add_truncate, $skip, $skiplike, $no_comments, $takelike, $mysql_loadfile ); GetOptions( 'add-truncate' => \$add_truncate, 'h|help' => \$help, 'no-comments' => \$no_comments, 'mysql-loadfile' => \$mysql_loadfile, 'skip:s' => \$skip, 'skiplike:s' => \$skiplike, 'takelike:s' => \$takelike, ); if ( $help ) { print <<"USAGE"; Usage: $0 [options] > dump.sql Options: -h|--help Show help and exit --add-truncate Add "TRUNCATE TABLE" statements --mysql-loadfile Create MySQL's LOAD FILE syntax, not INSERTs --no-comments Suppress comments --skip=t1[,t2] Comma-separated list of tables to skip --skiplike=regex Regular expression of table names to skip --takelike=regex Regular expression of table names to take USAGE exit(0); } $no_comments = 1 if $mysql_loadfile; [%- SET table_defs = []; SET max_field = 0; FOREACH table IN schema.get_tables; SET table_name = table.name; NEXT IF skip.$table_name; NEXT IF skiplike AND table_name.match("(?:$skiplike)"); SET field_names = []; SET types = {}; FOR field IN table.get_fields; field_name = field.name; fname_len = field.name.length; max_field = fname_len > max_field ? fname_len : max_field; types.$field_name = field.data_type.match( '(char|str|long|text|enum|date)' ) ? 'string' : 'number'; field_names.push( field_name ); END; table_defs.push({ name => table_name, types => types, fields => field_names, }); END -%] my $db = DBI->connect( '[% dsn %]', '[% db_user %]', '[% db_pass %]', { RaiseError => 1 } ); my %skip = map { $_, 1 } map { s/^\s+|\s+$//; $_ } split (/,/, $skip); my @tables = ( [%- FOREACH t IN table_defs %] { table_name => '[% t.name %]', fields => [ qw/ [% t.fields.join(' ') %] / ], types => { [%- FOREACH fname IN t.types.keys %] '[% fname %]' => '[% t.types.$fname %]', [%- END %] }, }, [%- END %] ); for my $table ( @tables ) { my $table_name = $table->{'table_name'}; next if $skip{ $table_name }; next if $skiplike && $table_name =~ qr/$skiplike/; next if $takelike && $table_name !~ qr/$takelike/; my ( $out_fh, $outfile ); if ( $mysql_loadfile ) { $outfile = catfile( cwd(), "$table_name.txt" ); open $out_fh, ">$outfile" or die "Can't write LOAD FILE to '$table_name': $!\n"; } print "--\n-- Data for table '$table_name'\n--\n" unless $no_comments; if ( $add_truncate ) { print "TRUNCATE TABLE $table_name;\n"; } my $sql = 'select ' . join(', ', @{ $table->{'fields'} } ) . " from $table_name" ; my $sth = $db->prepare( $sql ); $sth->execute; while ( my $rec = $sth->fetchrow_hashref ) { my @vals; for my $fld ( @{ $table->{'fields'} } ) { my $val = $rec->{ $fld }; if ( $table->{'types'}{ $fld } eq 'string' ) { if ( defined $val ) { $val =~ s/'/\\'/g; $val = qq['$val'] } else { $val = qq['']; } } else { $val = defined $val ? $val : $mysql_loadfile ? '\N' : 'NULL'; } push @vals, $val; } if ( $mysql_loadfile ) { print $out_fh join("\t", @vals), "\n"; } else { print "INSERT INTO $table_name (". join(', ', @{ $table->{'fields'} }) . ') VALUES (', join(', ', @vals), ");\n"; } } if ( $out_fh ) { print "LOAD DATA INFILE '$outfile' INTO TABLE $table_name ", "FIELDS OPTIONALLY ENCLOSED BY '\\'';\n"; close $out_fh or die "Can't close filehandle: $!\n"; } else { print "\n"; } } EOF } 1; # ------------------------------------------------------------------- # To create a little flower is the labour of ages. # William Blake # ------------------------------------------------------------------- =pod =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11018/lib/SQL/Translator/Producer/XML/0000755000175000017500000000000012234461403020722 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Producer/XML/SQLFairy.pm0000644000175000017500000002605112234455220022716 0ustar frewfrewpackage SQL::Translator::Producer::XML::SQLFairy; =pod =head1 NAME SQL::Translator::Producer::XML::SQLFairy - SQLFairy's default XML format =head1 SYNOPSIS use SQL::Translator; my $t = SQL::Translator->new( from => 'MySQL', to => 'XML-SQLFairy', filename => 'schema.sql', show_warnings => 1, ); print $t->translate; =head1 DESCRIPTION Creates XML output of a schema, in the flavor of XML used natively by the SQLFairy project (L). This format is detailed here. The XML lives in the C namespace. With a root element of . Objects in the schema are mapped to tags of the same name as the objects class (all lowercase). The attributes of the objects (e.g. $field->name) are mapped to attributes of the tag, except for sql, comments and action, which get mapped to child data elements. List valued attributes (such as the list of fields in an index) get mapped to comma separated lists of values in the attribute. Child objects, such as a tables fields, get mapped to child tags wrapped in a set of container tags using the plural of their contained classes name. An objects' extra attribute (a hash of arbitrary data) is mapped to a tag called extra, with the hash of data as attributes, sorted into alphabetical order. e.g. ...
SELECT email FROM Basic WHERE email IS NOT NULL
To see a complete example of the XML translate one of your schema :) $ sqlt -f MySQL -t XML-SQLFairy schema.sql =head1 ARGS =over 4 =item add_prefix Set to true to use the default namespace prefix of 'sqlf', instead of using the default namespace for C e.g. =item prefix Set to the namespace prefix you want to use for the C e.g. =item newlines If true (the default) inserts newlines around the XML, otherwise the schema is written on one line. =item indent When using newlines the number of whitespace characters to use as the indent. Default is 2, set to 0 to turn off indenting. =back =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. The old producer could produce attribute only or data element only versions. While this allowed 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 above. This version of the producer will now only produce the new style XML. 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 @EXPORT_OK; our $VERSION = '1.59'; use Exporter; use base qw(Exporter); @EXPORT_OK = qw(produce); use SQL::Translator::Utils qw(header_comment debug); BEGIN { # Will someone fix XML::Writer already? local $^W = 0; require XML::Writer; import XML::Writer; } # Which schema object attributes (methods) to write as xml elements rather than # as attributes. e.g. blah, blah... my @MAP_AS_ELEMENTS = qw/sql comments action extra/; my $Namespace = 'http://sqlfairy.sourceforge.net/sqlfairy.xml'; my $Name = 'sqlf'; my $PArgs = {}; my $no_comments; sub produce { my $translator = shift; my $schema = $translator->schema; $no_comments = $translator->no_comments; $PArgs = $translator->producer_args; my $newlines = defined $PArgs->{newlines} ? $PArgs->{newlines} : 1; my $indent = defined $PArgs->{indent} ? $PArgs->{indent} : 2; # Setup the XML::Writer and set the namespace my $io; my $prefix = ""; $prefix = $Name if $PArgs->{add_prefix}; $prefix = $PArgs->{prefix} if $PArgs->{prefix}; my $xml = XML::Writer->new( OUTPUT => \$io, NAMESPACES => 1, PREFIX_MAP => { $Namespace => $prefix }, DATA_MODE => $newlines, DATA_INDENT => $indent, ); # Start the document $xml->xmlDecl('UTF-8'); $xml->comment(header_comment('', '')) unless $no_comments; xml_obj($xml, $schema, tag => "schema", methods => [qw/name database extra/], end_tag => 0 ); # # Table # $xml->startTag( [ $Namespace => "tables" ] ); for my $table ( $schema->get_tables ) { debug "Table:",$table->name; xml_obj($xml, $table, tag => "table", methods => [qw/name order extra/], end_tag => 0 ); # # Fields # xml_obj_children( $xml, $table, tag => 'field', methods =>[qw/ name data_type size is_nullable default_value is_auto_increment is_primary_key is_foreign_key extra comments order /], ); # # Indices # xml_obj_children( $xml, $table, tag => 'index', collection_tag => "indices", methods => [qw/name type fields options extra/], ); # # Constraints # xml_obj_children( $xml, $table, tag => 'constraint', methods => [qw/ name type fields reference_table reference_fields on_delete on_update match_type expression options deferrable extra /], ); # # Comments # xml_obj_children( $xml, $table, tag => 'comment', collection_tag => "comments", methods => [qw/ comments /], ); $xml->endTag( [ $Namespace => 'table' ] ); } $xml->endTag( [ $Namespace => 'tables' ] ); # # Views # xml_obj_children( $xml, $schema, tag => 'view', methods => [qw/name sql fields order extra/], ); # # Tiggers # xml_obj_children( $xml, $schema, tag => 'trigger', methods => [qw/name database_events action on_table perform_action_when fields order extra/], ); # # Procedures # xml_obj_children( $xml, $schema, tag => 'procedure', methods => [qw/name sql parameters owner comments order extra/], ); $xml->endTag([ $Namespace => 'schema' ]); $xml->end; return $io; } # # Takes and XML::Write object, Schema::* parent object, the tag name, # the collection name and a list of methods (of the children) to write as XML. # The collection name defaults to the name with an s on the end and is used to # work out the method to get the children with. eg a name of 'foo' gives a # collection of foos and gets the members using ->get_foos. # sub xml_obj_children { my ($xml,$parent) = (shift,shift); my %args = @_; my ($name,$collection_name,$methods) = @args{qw/tag collection_tag methods/}; $collection_name ||= "${name}s"; my $meth; if ( $collection_name eq 'comments' ) { $meth = 'comments'; } else { $meth = "get_$collection_name"; } my @kids = $parent->$meth; #@kids || return; $xml->startTag( [ $Namespace => $collection_name ] ); for my $obj ( @kids ) { if ( $collection_name eq 'comments' ){ $xml->dataElement( [ $Namespace => 'comment' ], $obj ); } else { xml_obj($xml, $obj, tag => "$name", end_tag => 1, methods => $methods, ); } } $xml->endTag( [ $Namespace => $collection_name ] ); } # # Takes an XML::Writer, Schema::* object and list of method names # and writes the object out as XML. All methods values are written as attributes # except for the methods listed in @MAP_AS_ELEMENTS which get written as child # data elements. # # The attributes/tags are written in the same order as the method names are # passed. # # TODO # - Should the Namespace be passed in instead of global? Pass in the same # as Writer ie [ NS => TAGNAME ] # my $elements_re = join("|", @MAP_AS_ELEMENTS); $elements_re = qr/^($elements_re)$/; sub xml_obj { my ($xml, $obj, %args) = @_; my $tag = $args{'tag'} || ''; my $end_tag = $args{'end_tag'} || ''; my @meths = @{ $args{'methods'} }; my $empty_tag = 0; # Use array to ensure consistent (ie not hash) ordering of attribs # The order comes from the meths list passed in. my @tags; my @attr; foreach ( grep { defined $obj->$_ } @meths ) { my $what = m/$elements_re/ ? \@tags : \@attr; my $val = $_ eq 'extra' ? { $obj->$_ } : $obj->$_; $val = ref $val eq 'ARRAY' ? join(',', @$val) : $val; push @$what, $_ => $val; }; my $child_tags = @tags; $end_tag && !$child_tags ? $xml->emptyTag( [ $Namespace => $tag ], @attr ) : $xml->startTag( [ $Namespace => $tag ], @attr ); while ( my ($name,$val) = splice @tags,0,2 ) { if ( ref $val eq 'HASH' ) { $xml->emptyTag( [ $Namespace => $name ], map { ($_, $val->{$_}) } sort keys %$val ); } else { $xml->dataElement( [ $Namespace => $name ], $val ); } } $xml->endTag( [ $Namespace => $tag ] ) if $child_tags && $end_tag; } 1; # ------------------------------------------------------------------- # The eyes of fire, the nostrils of air, # The mouth of water, the beard of earth. # William Blake # ------------------------------------------------------------------- =pod =head1 AUTHORS Ken Youens-Clark Ekclark@cpan.orgE, Darren Chamberlain Edarren@cpan.orgE, Mark Addison Emark.addison@itn.co.ukE. =head1 SEE ALSO L, L, L, L, L. =cut SQL-Translator-0.11018/lib/SQL/Translator/Producer/DiaUml.pm0000644000175000017500000000303112234455220021770 0ustar frewfrewpackage SQL::Translator::Producer::DiaUml; =pod =head1 NAME SQL::Translator::Producer::DiaUml - Produces dia UML diagrams from schema. =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new( from => 'MySQL', filename => 'foo_schema.sql', to => 'DiaUml', ); print $translator->translate; =head1 DESCRIPTION Currently you will get one class (with the a table stereotype) generated per table in the schema. The fields are added as attributes of the classes and their datatypes set. It doesn't currently set any of the relationships. It doesn't do any layout, all the classes are in one big stack. However it is still useful as you can use the layout tools in Dia to automatically arrange them horizontally or vertically. =head2 Producer Args =over 4 =back =cut use strict; use warnings; our ( $DEBUG, @EXPORT_OK ); our $VERSION = '1.59'; $DEBUG = 0 unless defined $DEBUG; use File::ShareDir qw/dist_dir/; use SQL::Translator::Utils 'debug'; use base qw/SQL::Translator::Producer::TT::Base/; # Convert produce call into a method call on our class sub produce { return __PACKAGE__->new( translator => shift )->run; }; sub tt_config { ( INCLUDE_PATH => File::Spec->catdir (dist_dir('SQL-Translator'), 'DiaUml') ); } sub tt_schema { 'schema.tt2' } 1; =pod =head1 AUTHOR Mark Addison Egrommit@users.sourceforge.netE. =head1 TODO * Add the foreign keys from the schema as UML relations. * Layout the classes. =head1 SEE ALSO SQL::Translator. =cut SQL-Translator-0.11018/lib/SQL/Translator/Producer/Latex.pm0000644000175000017500000000361112234455220021676 0ustar frewfrewpackage SQL::Translator::Producer::Latex; =pod =head1 NAME SQL::Translator::Producer::Latex - Produces latex formatted tables ready for import from schema. =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new( from => 'MySQL', filename => 'foo_schema.sql', to => 'Latex', ); print $translator->translate; =head1 DESCRIPTION Currently you will get one class (with the a table stereotype) generated per table in the schema. The fields are added as attributes of the classes and their datatypes set. It doesn't currently set any of the relationships. It doesn't do any layout, all the classes are in one big stack. However it is still useful as you can use the layout tools in Dia to automatically arrange them horizontally or vertically. =head2 Producer Args =over 4 =back =cut use strict; use warnings; our @EXPORT_OK; our $VERSION = '1.59'; use SQL::Translator::Utils 'debug'; sub produce { my $translator = shift; my $schema = $translator->schema; my $o = ''; for my $table ( $schema->get_tables ) { my $table_name = $table->name or next; my $n = latex($table_name); $o .= sprintf ' \subsubsection{%s} %s \begin{table}[htb] \caption{%s} \label{tab:%s} \center { \small \begin{tabular}{l l p{8cm}} Column & Datatype & Description \\\\ \hline ', $n, latex($table->comments), $n, $table_name; foreach my $f ($table->get_fields) { $o .= sprintf '%s & %s & %s \\\\', map {latex($_)} ($f->name, $f->data_type, $f->comments || ''); $o .= "\n"; } $o .= sprintf ' \end{tabular} } \end{table} \clearpage '; } return $o; } sub latex { my $s = shift; return '' unless defined $s; $s =~ s/([\&\_\$\{\#])/\\$1/g; return $s; } 1; =pod =head1 AUTHOR Chris Mungall =head1 SEE ALSO SQL::Translator. =cut SQL-Translator-0.11018/lib/SQL/Translator/Producer/PostgreSQL.pm0000644000175000017500000010035112234455220022623 0ustar frewfrewpackage SQL::Translator::Producer::PostgreSQL; =head1 NAME SQL::Translator::Producer::PostgreSQL - PostgreSQL producer for SQL::Translator =head1 SYNOPSIS my $t = SQL::Translator->new( parser => '...', producer => 'PostgreSQL' ); $t->translate; =head1 DESCRIPTION Creates a DDL suitable for PostgreSQL. Very heavily based on the Oracle producer. Now handles PostGIS Geometry and Geography data types on table definitions. Does not yet support PostGIS Views. =cut use strict; use warnings; our ( $DEBUG, $WARN ); our $VERSION = '1.59'; $DEBUG = 0 unless defined $DEBUG; use base qw(SQL::Translator::Producer); use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(debug header_comment parse_dbms_version); use SQL::Translator::Generator::DDL::PostgreSQL; use Data::Dumper; my $generator = SQL::Translator::Generator::DDL::PostgreSQL->new; my ( %translate, %index_name ); my $max_id_length; BEGIN { %translate = ( # # MySQL types # bigint => 'bigint', double => 'numeric', decimal => 'numeric', float => 'numeric', int => 'integer', mediumint => 'integer', smallint => 'smallint', tinyint => 'smallint', char => 'character', varchar => 'character varying', longtext => 'text', mediumtext => 'text', text => 'text', tinytext => 'text', tinyblob => 'bytea', blob => 'bytea', mediumblob => 'bytea', longblob => 'bytea', enum => 'character varying', set => 'character varying', date => 'date', datetime => 'timestamp', time => 'time', timestamp => 'timestamp', year => 'date', # # Oracle types # number => 'integer', char => 'character', varchar2 => 'character varying', long => 'text', CLOB => 'bytea', date => 'date', # # Sybase types # int => 'integer', money => 'money', varchar => 'character varying', datetime => 'timestamp', text => 'text', real => 'numeric', comment => 'text', bit => 'bit', tinyint => 'smallint', float => 'numeric', ); $max_id_length = 62; } my %reserved = map { $_, 1 } qw[ ALL ANALYSE ANALYZE AND ANY AS ASC BETWEEN BINARY BOTH CASE CAST CHECK COLLATE COLUMN CONSTRAINT CROSS CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER DEFAULT DEFERRABLE DESC DISTINCT DO ELSE END EXCEPT FALSE FOR FOREIGN FREEZE FROM FULL GROUP HAVING ILIKE IN INITIALLY INNER INTERSECT INTO IS ISNULL JOIN LEADING LEFT LIKE LIMIT NATURAL NEW NOT NOTNULL NULL OFF OFFSET OLD ON ONLY OR ORDER OUTER OVERLAPS PRIMARY PUBLIC REFERENCES RIGHT SELECT SESSION_USER SOME TABLE THEN TO TRAILING TRUE UNION UNIQUE USER USING VERBOSE WHEN WHERE ]; # my $max_id_length = 62; my %used_identifiers = (); my %global_names; my %truncated; =pod =head1 PostgreSQL Create Table Syntax CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name ( { column_name data_type [ DEFAULT default_expr ] [ column_constraint [, ... ] ] | table_constraint } [, ... ] ) [ INHERITS ( parent_table [, ... ] ) ] [ WITH OIDS | WITHOUT OIDS ] where column_constraint is: [ CONSTRAINT constraint_name ] { NOT NULL | NULL | UNIQUE | PRIMARY KEY | CHECK (expression) | REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] } [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] and table_constraint is: [ CONSTRAINT constraint_name ] { UNIQUE ( column_name [, ... ] ) | PRIMARY KEY ( column_name [, ... ] ) | CHECK ( expression ) | FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] } [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] =head1 Create Index Syntax CREATE [ UNIQUE ] INDEX index_name ON table [ USING acc_method ] ( column [ ops_name ] [, ...] ) [ WHERE predicate ] CREATE [ UNIQUE ] INDEX index_name ON table [ USING acc_method ] ( func_name( column [, ... ]) [ ops_name ] ) [ WHERE predicate ] =cut sub produce { my $translator = shift; local $DEBUG = $translator->debug; local $WARN = $translator->show_warnings; my $no_comments = $translator->no_comments; my $add_drop_table = $translator->add_drop_table; my $schema = $translator->schema; my $pargs = $translator->producer_args; my $postgres_version = parse_dbms_version( $pargs->{postgres_version}, 'perl' ); my $qt = $translator->quote_table_names ? q{"} : q{}; my $qf = $translator->quote_field_names ? q{"} : q{}; $generator->quote_chars([$qt]); my @output; push @output, header_comment unless ($no_comments); my (@table_defs, @fks); my %type_defs; for my $table ( $schema->get_tables ) { my ($table_def, $fks) = create_table($table, { quote_table_names => $qt, quote_field_names => $qf, no_comments => $no_comments, postgres_version => $postgres_version, add_drop_table => $add_drop_table, type_defs => \%type_defs, }); push @table_defs, $table_def; push @fks, @$fks; } for my $view ( $schema->get_views ) { push @table_defs, create_view($view, { postgres_version => $postgres_version, add_drop_view => $add_drop_table, quote_table_names => $qt, quote_field_names => $qf, no_comments => $no_comments, }); } for my $trigger ( $schema->get_triggers ) { push @table_defs, create_trigger( $trigger, { add_drop_trigger => $add_drop_table, no_comments => $no_comments, }); } push @output, map { "$_;\n\n" } values %type_defs; push @output, map { "$_;\n\n" } @table_defs; if ( @fks ) { push @output, "--\n-- Foreign Key Definitions\n--\n\n" unless $no_comments; push @output, map { "$_;\n\n" } @fks; } if ( $WARN ) { if ( %truncated ) { warn "Truncated " . keys( %truncated ) . " names:\n"; warn "\t" . join( "\n\t", sort keys %truncated ) . "\n"; } } return wantarray ? @output : join ('', @output); } sub mk_name { my $basename = shift || ''; my $type = shift || ''; my $scope = shift || ''; my $critical = shift || ''; my $basename_orig = $basename; # my $max_id_length = 62; my $max_name = $type ? $max_id_length - (length($type) + 1) : $max_id_length; $basename = substr( $basename, 0, $max_name ) if length( $basename ) > $max_name; my $name = $type ? "${type}_$basename" : $basename; if ( $basename ne $basename_orig and $critical ) { my $show_type = $type ? "+'$type'" : ""; warn "Truncating '$basename_orig'$show_type to $max_id_length ", "character limit to make '$name'\n" if $WARN; $truncated{ $basename_orig } = $name; } $scope ||= \%global_names; if ( my $prev = $scope->{ $name } ) { my $name_orig = $name; $name .= sprintf( "%02d", ++$prev ); substr($name, $max_id_length - 3) = "00" if length( $name ) > $max_id_length; warn "The name '$name_orig' has been changed to ", "'$name' to make it unique.\n" if $WARN; $scope->{ $name_orig }++; } $scope->{ $name }++; return $name; } sub is_geometry { my $field = shift; return 1 if $field->data_type eq 'geometry'; } sub is_geography { my $field = shift; return 1 if $field->data_type eq 'geography'; } sub create_table { my ($table, $options) = @_; my $qt = $options->{quote_table_names} || ''; my $qf = $options->{quote_field_names} || ''; $generator->quote_chars([$qt]); my $no_comments = $options->{no_comments} || 0; my $add_drop_table = $options->{add_drop_table} || 0; my $postgres_version = $options->{postgres_version} || 0; my $type_defs = $options->{type_defs} || {}; my $table_name = $table->name or next; my ( $fql_tbl_name ) = ( $table_name =~ s/\W(.*)$// ) ? $1 : q{}; my $table_name_ur = $qt ? join('.', $table_name, $fql_tbl_name) : $fql_tbl_name ? join('.', $table_name, $fql_tbl_name) : $table_name; # print STDERR "$table_name table_name\n"; my ( @comments, @field_defs, @sequence_defs, @constraint_defs, @fks ); push @comments, "--\n-- Table: $table_name_ur\n--\n" unless $no_comments; if ( $table->comments and !$no_comments ){ my $c = "-- Comments: \n-- "; $c .= join "\n-- ", $table->comments; $c .= "\n--\n"; push @comments, $c; } # # Fields # my %field_name_scope; for my $field ( $table->get_fields ) { push @field_defs, create_field($field, { quote_table_names => $qt, quote_field_names => $qf, table_name => $table_name_ur, postgres_version => $postgres_version, type_defs => $type_defs, constraint_defs => \@constraint_defs,}); } # # Index Declarations # my @index_defs = (); # my $idx_name_default; for my $index ( $table->get_indices ) { my ($idef, $constraints) = create_index($index, { quote_field_names => $qf, quote_table_names => $qt, table_name => $table_name, }); $idef and push @index_defs, $idef; push @constraint_defs, @$constraints; } # # Table constraints # my $c_name_default; for my $c ( $table->get_constraints ) { my ($cdefs, $fks) = create_constraint($c, { quote_field_names => $qf, quote_table_names => $qt, table_name => $table_name, }); push @constraint_defs, @$cdefs; push @fks, @$fks; } my $temporary = ""; if(exists $table->extra->{temporary}) { $temporary = $table->extra->{temporary} ? "TEMPORARY " : ""; } my $create_statement; $create_statement = join("\n", @comments); if ($add_drop_table) { if ($postgres_version >= 8.002) { $create_statement .= 'DROP TABLE IF EXISTS ' . $generator->quote($table_name_ur) . " CASCADE;\n"; } else { $create_statement .= 'DROP TABLE ' . $generator->quote($table_name_ur) . " CASCADE;\n"; } } $create_statement .= "CREATE ${temporary}TABLE " . $generator->quote($table_name_ur) . " (\n" . join( ",\n", map { " $_" } @field_defs, @constraint_defs ). "\n)" ; $create_statement .= @index_defs ? ';' : q{}; $create_statement .= ( $create_statement =~ /;$/ ? "\n" : q{} ) . join(";\n", @index_defs); # # Geometry # if(grep { is_geometry($_) } $table->get_fields){ $create_statement .= ";"; my @geometry_columns; foreach my $col ($table->get_fields) { push(@geometry_columns,$col) if is_geometry($col); } $create_statement .= "\n".join("\n", map{ drop_geometry_column($_) } @geometry_columns) if $options->{add_drop_table}; $create_statement .= "\n".join("\n", map{ add_geometry_column($_) } @geometry_columns); } return $create_statement, \@fks; } sub create_view { my ($view, $options) = @_; my $qt = $options->{quote_table_names} || ''; my $qf = $options->{quote_field_names} || ''; $generator->quote_chars([$qt]); my $postgres_version = $options->{postgres_version} || 0; my $add_drop_view = $options->{add_drop_view}; my $view_name = $view->name; debug("PKG: Looking at view '${view_name}'\n"); my $create = ''; $create .= "--\n-- View: " . $generator->quote($view_name) . "\n--\n" unless $options->{no_comments}; if ($add_drop_view) { if ($postgres_version >= 8.002) { $create .= "DROP VIEW IF EXISTS " . $generator->quote($view_name) . ";\n"; } else { $create .= "DROP VIEW " . $generator->quote($view_name) . ";\n"; } } $create .= 'CREATE'; my $extra = $view->extra; $create .= " TEMPORARY" if exists($extra->{temporary}) && $extra->{temporary}; $create .= " VIEW " . $generator->quote($view_name); if ( my @fields = $view->fields ) { my $field_list = join ', ', map { $generator->quote($_) } @fields; $create .= " ( ${field_list} )"; } if ( my $sql = $view->sql ) { $create .= " AS\n ${sql}\n"; } if ( $extra->{check_option} ) { $create .= ' WITH ' . uc $extra->{check_option} . ' CHECK OPTION'; } return $create; } { my %field_name_scope; sub create_field { my ($field, $options) = @_; my $qt = $options->{quote_table_names} || ''; my $qf = $options->{quote_field_names} || ''; $generator->quote_chars([$qt]); my $table_name = $field->table->name; my $constraint_defs = $options->{constraint_defs} || []; my $postgres_version = $options->{postgres_version} || 0; my $type_defs = $options->{type_defs} || {}; $field_name_scope{$table_name} ||= {}; my $field_name = $field->name; my $field_comments = $field->comments ? "-- " . $field->comments . "\n " : ''; my $field_def = $field_comments . $generator->quote($field_name); # # Datatype # my @size = $field->size; my $data_type = lc $field->data_type; my %extra = $field->extra; my $list = $extra{'list'} || []; # todo deal with embedded quotes my $commalist = join( ', ', map { qq['$_'] } @$list ); if ($postgres_version >= 8.003 && $field->data_type eq 'enum') { my $type_name = $extra{'custom_type_name'} || $field->table->name . '_' . $field->name . '_type'; $field_def .= ' '. $type_name; my $new_type_def = "DROP TYPE IF EXISTS $type_name CASCADE;\n" . "CREATE TYPE $type_name AS ENUM ($commalist)"; if (! exists $type_defs->{$type_name} ) { $type_defs->{$type_name} = $new_type_def; } elsif ( $type_defs->{$type_name} ne $new_type_def ) { die "Attempted to redefine type name '$type_name' as a different type.\n"; } } else { $field_def .= ' '. convert_datatype($field); } # # Default value # SQL::Translator::Producer->_apply_default_value( $field, \$field_def, [ 'NULL' => \'NULL', 'now()' => 'now()', 'CURRENT_TIMESTAMP' => 'CURRENT_TIMESTAMP', ], ); # # Not null constraint # $field_def .= ' NOT NULL' unless $field->is_nullable; # # Geometry constraints # if(is_geometry($field)){ foreach ( create_geometry_constraints($field) ) { my ($cdefs, $fks) = create_constraint($_, { quote_field_names => $qf, quote_table_names => $qt, table_name => $table_name, }); push @$constraint_defs, @$cdefs; push @$fks, @$fks; } } return $field_def; } } sub create_geometry_constraints{ my $field = shift; my @constraints; push @constraints, SQL::Translator::Schema::Constraint->new( name => "enforce_dims_".$field->name, expression => "(ST_NDims($field) = ".$field->extra->{dimensions}.")", table => $field->table, type => CHECK_C, ); push @constraints, SQL::Translator::Schema::Constraint->new( name => "enforce_srid_".$field->name, expression => "(ST_SRID($field) = ".$field->extra->{srid}.")", table => $field->table, type => CHECK_C, ); push @constraints, SQL::Translator::Schema::Constraint->new( name => "enforce_geotype_".$field->name, expression => "(GeometryType($field) = '".$field->extra->{geometry_type}."'::text OR $field IS NULL)", table => $field->table, type => CHECK_C, ); return @constraints; } sub create_index { my ($index, $options) = @_; my $qt = $options->{quote_table_names} ||''; my $qf = $options->{quote_field_names} ||''; $generator->quote_chars([$qt]); my $table_name = $index->table->name; my ($index_def, @constraint_defs); my $name = $index->name || join('_', $table_name, 'idx', ++$index_name{ $table_name }); my $type = $index->type || NORMAL; my @fields = $index->fields; return unless @fields; my $def_start = 'CONSTRAINT ' . $generator->quote($name) . ' '; my $field_names = '(' . join(", ", (map { $_ =~ /\(.*\)/ ? $_ : ( $generator->quote($_) ) } @fields)) . ')'; if ( $type eq PRIMARY_KEY ) { push @constraint_defs, "${def_start}PRIMARY KEY ".$field_names; } elsif ( $type eq UNIQUE ) { push @constraint_defs, "${def_start}UNIQUE " .$field_names; } elsif ( $type eq NORMAL ) { $index_def = 'CREATE INDEX ' . $generator->quote($name) . ' on ' . $generator->quote($table_name) . ' ' . $field_names ; } else { warn "Unknown index type ($type) on table $table_name.\n" if $WARN; } return $index_def, \@constraint_defs; } sub create_constraint { my ($c, $options) = @_; my $qf = $options->{quote_field_names} ||''; my $qt = $options->{quote_table_names} ||''; $generator->quote_chars([$qt]); my $table_name = $c->table->name; my (@constraint_defs, @fks); my $name = $c->name || ''; my @fields = grep { defined } $c->fields; my @rfields = grep { defined } $c->reference_fields; next if !@fields && $c->type ne CHECK_C; my $def_start = $name ? 'CONSTRAINT ' . $generator->quote($name) . ' ' : ''; my $field_names = '(' . join(", ", (map { $_ =~ /\(.*\)/ ? $_ : ( $generator->quote($_) ) } @fields)) . ')'; if ( $c->type eq PRIMARY_KEY ) { push @constraint_defs, "${def_start}PRIMARY KEY ".$field_names; } elsif ( $c->type eq UNIQUE ) { push @constraint_defs, "${def_start}UNIQUE " .$field_names; } elsif ( $c->type eq CHECK_C ) { my $expression = $c->expression; push @constraint_defs, "${def_start}CHECK ($expression)"; } elsif ( $c->type eq FOREIGN_KEY ) { my $def .= "ALTER TABLE " . $generator->quote($table_name) . " ADD ${def_start}FOREIGN KEY $field_names" . "\n REFERENCES " . $generator->quote($c->reference_table); if ( @rfields ) { $def .= ' (' . join( ', ', map { $generator->quote($_) } @rfields ) . ')'; } if ( $c->match_type ) { $def .= ' MATCH ' . ( $c->match_type =~ /full/i ) ? 'FULL' : 'PARTIAL'; } if ( $c->on_delete ) { $def .= ' ON DELETE '. $c->on_delete; } if ( $c->on_update ) { $def .= ' ON UPDATE '. $c->on_update; } if ( $c->deferrable ) { $def .= ' DEFERRABLE'; } push @fks, "$def"; } return \@constraint_defs, \@fks; } sub create_trigger { my ($trigger,$options) = @_; my @statements; push @statements, sprintf( 'DROP TRIGGER IF EXISTS %s', $trigger->name ) if $options->{add_drop_trigger}; my $scope = $trigger->scope || ''; $scope = " FOR EACH $scope" if $scope; push @statements, sprintf( 'CREATE TRIGGER %s %s %s ON %s%s %s', $trigger->name, $trigger->perform_action_when, join( ' OR ', @{ $trigger->database_events } ), $trigger->on_table, $scope, $trigger->action, ); return @statements; } sub convert_datatype { my ($field) = @_; my @size = $field->size; my $data_type = lc $field->data_type; my $array = $data_type =~ s/\[\]$//; if ( $data_type eq 'enum' ) { # my $len = 0; # $len = ($len < length($_)) ? length($_) : $len for (@$list); # my $chk_name = mk_name( $table_name.'_'.$field_name, 'chk' ); # push @$constraint_defs, # 'CONSTRAINT "$chk_name" CHECK (' . $generator->quote(field_name) . # qq[IN ($commalist))]; $data_type = 'character varying'; } elsif ( $data_type eq 'set' ) { $data_type = 'character varying'; } elsif ( $field->is_auto_increment ) { if ( defined $size[0] && $size[0] > 11 ) { $data_type = 'bigserial'; } else { $data_type = 'serial'; } undef @size; } else { $data_type = defined $translate{ $data_type } ? $translate{ $data_type } : $data_type; } if ( $data_type =~ /^time/i || $data_type =~ /^interval/i ) { if ( defined $size[0] && $size[0] > 6 ) { $size[0] = 6; } } if ( $data_type eq 'integer' ) { if ( defined $size[0] && $size[0] > 0) { if ( $size[0] > 10 ) { $data_type = 'bigint'; } elsif ( $size[0] < 5 ) { $data_type = 'smallint'; } else { $data_type = 'integer'; } } else { $data_type = 'integer'; } } my $type_with_size = join('|', 'bit', 'varbit', 'character', 'bit varying', 'character varying', 'time', 'timestamp', 'interval', 'numeric' ); if ( $data_type !~ /$type_with_size/ ) { @size = (); } if (defined $size[0] && $size[0] > 0 && $data_type =~ /^time/i ) { $data_type =~ s/^(time.*?)( with.*)?$/$1($size[0])/; $data_type .= $2 if(defined $2); } elsif ( defined $size[0] && $size[0] > 0 ) { $data_type .= '(' . join( ',', @size ) . ')'; } if($array) { $data_type .= '[]'; } # # Geography # if($data_type eq 'geography'){ $data_type .= '('.$field->extra->{geography_type}.','. $field->extra->{srid} .')' } return $data_type; } sub alter_field { my ($from_field, $to_field) = @_; die "Can't alter field in another table" if($from_field->table->name ne $to_field->table->name); my @out; # drop geometry column and constraints push @out, drop_geometry_column($from_field) if is_geometry($from_field); push @out, drop_geometry_constraints($from_field) if is_geometry($from_field); # it's necessary to start with rename column cause this would affect # all of the following statements which would be broken if do the # rename later # BUT: drop geometry is done before the rename, cause it work's on the # $from_field directly push @out, sprintf('ALTER TABLE %s RENAME COLUMN %s TO %s', $to_field->table->name, $from_field->name, $to_field->name) if($from_field->name ne $to_field->name); push @out, sprintf('ALTER TABLE %s ALTER COLUMN %s SET NOT NULL', $to_field->table->name, $to_field->name) if(!$to_field->is_nullable and $from_field->is_nullable); push @out, sprintf('ALTER TABLE %s ALTER COLUMN %s DROP NOT NULL', $to_field->table->name, $to_field->name) if ( !$from_field->is_nullable and $to_field->is_nullable ); my $from_dt = convert_datatype($from_field); my $to_dt = convert_datatype($to_field); push @out, sprintf('ALTER TABLE %s ALTER COLUMN %s TYPE %s', $to_field->table->name, $to_field->name, $to_dt) if($to_dt ne $from_dt); my $old_default = $from_field->default_value; my $new_default = $to_field->default_value; my $default_value = $to_field->default_value; # fixes bug where output like this was created: # ALTER TABLE users ALTER COLUMN column SET DEFAULT ThisIsUnescaped; if(ref $default_value eq "SCALAR" ) { $default_value = $$default_value; } elsif( defined $default_value && $to_dt =~ /^(character|text)/xsmi ) { $default_value =~ s/'/''/xsmg; $default_value = q(') . $default_value . q('); } push @out, sprintf('ALTER TABLE %s ALTER COLUMN %s SET DEFAULT %s', $to_field->table->name, $to_field->name, $default_value) if ( defined $new_default && (!defined $old_default || $old_default ne $new_default) ); # fixes bug where removing the DEFAULT statement of a column # would result in no change push @out, sprintf('ALTER TABLE %s ALTER COLUMN %s DROP DEFAULT', $to_field->table->name, $to_field->name) if ( !defined $new_default && defined $old_default ); # add geometry column and constraints push @out, add_geometry_column($to_field) if is_geometry($to_field); push @out, add_geometry_constraints($to_field) if is_geometry($to_field); return wantarray ? @out : join(";\n", @out); } sub rename_field { alter_field(@_) } sub add_field { my ($new_field) = @_; my $out = sprintf('ALTER TABLE %s ADD COLUMN %s', $new_field->table->name, create_field($new_field)); $out .= "\n".add_geometry_column($new_field) if is_geometry($new_field); $out .= "\n".add_geometry_constraints($new_field) if is_geometry($new_field); return $out; } sub drop_field { my ($old_field, $options) = @_; my $qt = $options->{quote_table_names} ||''; my $qf = $options->{quote_field_names} ||''; $generator->quote_chars([$qt]); my $out = sprintf('ALTER TABLE %s DROP COLUMN %s', $generator->quote($old_field->table->name), $generator->quote($old_field->name)); $out .= "\n".drop_geometry_column($old_field) if is_geometry($old_field); return $out; } sub add_geometry_column{ my ($field,$options) = @_; my $out = sprintf("INSERT INTO geometry_columns VALUES ('%s','%s','%s','%s','%s','%s','%s')", '', $field->table->schema->name, $options->{table} ? $options->{table} : $field->table->name, $field->name, $field->extra->{dimensions}, $field->extra->{srid}, $field->extra->{geometry_type}); return $out; } sub drop_geometry_column { my $field = shift; my $out = sprintf("DELETE FROM geometry_columns WHERE f_table_schema = '%s' AND f_table_name = '%s' AND f_geometry_column = '%s'", $field->table->schema->name, $field->table->name, $field->name); return $out; } sub add_geometry_constraints{ my $field = shift; my @constraints = create_geometry_constraints($field); my $out = join("\n", map { alter_create_constraint($_); } @constraints); return $out; } sub drop_geometry_constraints{ my $field = shift; my @constraints = create_geometry_constraints($field); my $out = join("\n", map { alter_drop_constraint($_); } @constraints); return $out; } sub alter_table { my ($to_table, $options) = @_; my $qt = $options->{quote_table_names} || ''; $generator->quote_chars([$qt]); my $out = sprintf('ALTER TABLE %s %s', $generator->quote($to_table->name), $options->{alter_table_action}); $out .= "\n".$options->{geometry_changes} if $options->{geometry_changes}; return $out; } sub rename_table { my ($old_table, $new_table, $options) = @_; my $qt = $options->{quote_table_names} || ''; $generator->quote_chars([$qt]); $options->{alter_table_action} = "RENAME TO " . $generator->quote($new_table); my @geometry_changes; push @geometry_changes, map { drop_geometry_column($_); } grep { is_geometry($_) } $old_table->get_fields; push @geometry_changes, map { add_geometry_column($_, { table => $new_table }); } grep { is_geometry($_) } $old_table->get_fields; $options->{geometry_changes} = join ("\n",@geometry_changes) if scalar(@geometry_changes); return alter_table($old_table, $options); } sub alter_create_index { my ($index, $options) = @_; my $qt = $options->{quote_table_names} || ''; my $qf = $options->{quote_field_names} || ''; $generator->quote_chars([$qt]); my ($idef, $constraints) = create_index($index, { quote_field_names => $qf, quote_table_names => $qt, table_name => $index->table->name, }); return $index->type eq NORMAL ? $idef : sprintf('ALTER TABLE %s ADD %s', $generator->quote($index->table->name), join(q{}, @$constraints) ); } sub alter_drop_index { my ($index, $options) = @_; my $index_name = $index->name; return "DROP INDEX $index_name"; } sub alter_drop_constraint { my ($c, $options) = @_; my $qt = $options->{quote_table_names} || ''; my $qc = $options->{quote_field_names} || ''; $generator->quote_chars([$qt]); # attention: Postgres has a very special naming structure for naming # foreign keys and primary keys. It names them using the name of the # table as prefix and fkey or pkey as suffix, concatenated by an underscore my $c_name; if( $c->name ) { # Already has a name, just quote it $c_name = $qc . $c->name . $qc; } elsif ( $c->type eq FOREIGN_KEY ) { # Doesn't have a name, and is foreign key, append '_fkey' $c_name = $qc . $c->table->name . '_' . ($c->fields)[0] . '_fkey' . $qc; } elsif ( $c->type eq PRIMARY_KEY ) { # Doesn't have a name, and is primary key, append '_pkey' $c_name = $qc . $c->table->name . '_pkey' . $qc; } return sprintf( 'ALTER TABLE %s DROP CONSTRAINT %s', $qt . $c->table->name . $qt, $c_name ); } sub alter_create_constraint { my ($index, $options) = @_; my $qt = $options->{quote_table_names} || ''; $generator->quote_chars([$qt]); my ($defs, $fks) = create_constraint(@_); # return if there are no constraint definitions so we don't run # into output like this: # ALTER TABLE users ADD ; return unless(@{$defs} || @{$fks}); return $index->type eq FOREIGN_KEY ? join(q{}, @{$fks}) : join( ' ', 'ALTER TABLE', $generator->quote($index->table->name), 'ADD', join(q{}, @{$defs}, @{$fks}) ); } sub drop_table { my ($table, $options) = @_; my $qt = $options->{quote_table_names} || ''; $generator->quote_chars([$qt]); my $out = "DROP TABLE " . $generator->quote($table) . " CASCADE"; my @geometry_drops = map { drop_geometry_column($_); } grep { is_geometry($_) } $table->get_fields; $out .= "\n".join("\n",@geometry_drops) if scalar(@geometry_drops); return $out; } 1; # ------------------------------------------------------------------- # Life is full of misery, loneliness, and suffering -- # and it's all over much too soon. # Woody Allen # ------------------------------------------------------------------- =pod =head1 SEE ALSO SQL::Translator, SQL::Translator::Producer::Oracle. =head1 AUTHOR Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11018/lib/SQL/Translator/Producer/YAML.pm0000644000175000017500000001352412143357340021372 0ustar frewfrewpackage SQL::Translator::Producer::YAML; =head1 NAME SQL::Translator::Producer::YAML - A YAML producer for SQL::Translator =head1 SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new(producer => 'YAML'); =head1 DESCRIPTION This module uses YAML to serialize a schema to a string so that it can be saved to disk. Serializing a schema and then calling producers on the stored can realize significant performance gains when parsing takes a long time. =cut use strict; use warnings; our $VERSION = '1.59'; use YAML qw(Dump); sub produce { my $translator = shift; my $schema = $translator->schema; return Dump({ schema => { tables => { map { ($_->name => view_table($_)) } $schema->get_tables, }, views => { map { ($_->name => view_view($_)) } $schema->get_views, }, triggers => { map { ($_->name => view_trigger($_)) } $schema->get_triggers, }, procedures => { map { ($_->name => view_procedure($_)) } $schema->get_procedures, }, }, translator => { add_drop_table => $translator->add_drop_table, filename => $translator->filename, no_comments => $translator->no_comments, parser_args => $translator->parser_args, producer_args => $translator->producer_args, parser_type => $translator->parser_type, producer_type => $translator->producer_type, show_warnings => $translator->show_warnings, trace => $translator->trace, version => $translator->version, }, keys %{$schema->extra} ? ('extra' => { $schema->extra } ) : (), }); } sub view_table { my $table = shift; return { 'name' => $table->name, 'order' => $table->order, 'options' => $table->options || [], $table->comments ? ('comments' => $table->comments ) : (), 'constraints' => [ map { view_constraint($_) } $table->get_constraints ], 'indices' => [ map { view_index($_) } $table->get_indices ], 'fields' => { map { ($_->name => view_field($_)) } $table->get_fields }, keys %{$table->extra} ? ('extra' => { $table->extra } ) : (), }; } sub view_constraint { my $constraint = shift; return { 'deferrable' => scalar $constraint->deferrable, 'expression' => scalar $constraint->expression, 'fields' => [ map { ref $_ ? $_->name : $_ } $constraint->field_names ], 'match_type' => scalar $constraint->match_type, 'name' => scalar $constraint->name, 'options' => scalar $constraint->options, 'on_delete' => scalar $constraint->on_delete, 'on_update' => scalar $constraint->on_update, 'reference_fields' => [ map { ref $_ ? $_->name : $_ } $constraint->reference_fields ], 'reference_table' => scalar $constraint->reference_table, 'type' => scalar $constraint->type, keys %{$constraint->extra} ? ('extra' => { $constraint->extra } ) : (), }; } sub view_field { my $field = shift; return { 'order' => scalar $field->order, 'name' => scalar $field->name, 'data_type' => scalar $field->data_type, 'size' => [ $field->size ], 'default_value' => scalar $field->default_value, 'is_nullable' => scalar $field->is_nullable, 'is_primary_key' => scalar $field->is_primary_key, 'is_unique' => scalar $field->is_unique, $field->is_auto_increment ? ('is_auto_increment' => 1) : (), $field->comments ? ('comments' => $field->comments) : (), keys %{$field->extra} ? ('extra' => { $field->extra } ) : (), }; } sub view_procedure { my $procedure = shift; return { 'order' => scalar $procedure->order, 'name' => scalar $procedure->name, 'sql' => scalar $procedure->sql, 'parameters' => scalar $procedure->parameters, 'owner' => scalar $procedure->owner, 'comments' => scalar $procedure->comments, keys %{$procedure->extra} ? ('extra' => { $procedure->extra } ) : (), }; } sub view_trigger { my $trigger = shift; return { 'order' => scalar $trigger->order, 'name' => scalar $trigger->name, 'perform_action_when' => scalar $trigger->perform_action_when, 'database_events' => scalar $trigger->database_events, 'fields' => scalar $trigger->fields, 'on_table' => scalar $trigger->on_table, 'action' => scalar $trigger->action, keys %{$trigger->extra} ? ('extra' => { $trigger->extra } ) : (), }; } sub view_view { my $view = shift; return { 'order' => scalar $view->order, 'name' => scalar $view->name, 'sql' => scalar $view->sql, 'fields' => scalar $view->fields, keys %{$view->extra} ? ('extra' => { $view->extra } ) : (), }; } sub view_index { my $index = shift; return { 'name' => scalar $index->name, 'type' => scalar $index->type, 'fields' => scalar $index->fields, 'options' => scalar $index->options, keys %{$index->extra} ? ('extra' => { $index->extra } ) : (), }; } 1; =head1 SEE ALSO SQL::Translator, YAML, http://www.yaml.org/. =head1 AUTHORS darren chamberlain Edarren@cpan.orgE, Ken Youens-Clark Ekclark@cpan.orgE. =cut SQL-Translator-0.11018/lib/SQL/Translator/Producer/SQLServer.pm0000644000175000017500000000435312143357340022456 0ustar frewfrewpackage 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_tables => $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.11018/lib/SQL/Translator/Producer/TT/0000755000175000017500000000000012234461403020611 5ustar frewfrewSQL-Translator-0.11018/lib/SQL/Translator/Producer/TT/Table.pm0000644000175000017500000002137212234455220022203 0ustar frewfrewpackage 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 L 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.11018/lib/SQL/Translator/Producer/TT/Base.pm0000644000175000017500000002054712234455220022031 0ustar frewfrewpackage 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