NAME
MarpaX::Languages::SQL2003::AST - Translate SQL-2003 source to an AST
VERSION
version 0.003
SYNOPSIS
use strict;
use warnings FATAL => 'all';
use MarpaX::Languages::SQL2003::AST;
#
# Parse SQL
#
my $input = 'select * from myTable;';
my $obj = MarpaX::Languages::SQL2003::AST->new();
my $ast = $obj->parse($input);
my $xml = $obj->parse($input, xml => 1);
DESCRIPTION
This module translates SQL-2003 to an AST.
SUBROUTINES/METHODS
new($class)
Instantiate a new object.
parse($self, $input, %opts)
Parse $input and return $self. Accept an optional %opts hash that can be:
- xml
-
If true, produces the AST as an XML::LibXML::Document object. Default is a false value, meaning that the AST is a composite structure of blessed hash references and array references. Any LHS or RHS of the SQL grammar is a blessed hash. Any token is an array reference containing three items:
-
Any other key will be passed as-is to the Marpa's parse() method, i.e. it has to have a meaning to Marpa's recognizer. Typical examples are: trace_terminals => 1, trace_values => 1.
- start
-
Start position in the input stream.
- lengh
-
Lengh of the token in the input stream.
- text
-
Token value.
asXML($self, $input, %opts)
Alias to $self->parse($input, xml => 1, %opts).
asBlessed($self, $input, %opts)
Alias to $self->parse($input, xml => 0, %opts).
SEE ALSO
SUPPORT
Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker at https://rt.cpan.org/Public/Dist/Display.html?Name=MarpaX-Languages-SQL2003-AST. You will be notified automatically of any progress on your issue.
Source Code
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/jddurand/marpax-languages-sql2003-ast
git clone git://github.com/jddurand/marpax-languages-sql2003-ast.git
AUTHOR
Jean-Damien Durand <jeandamiendurand@free.fr>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Jean-Damien Durand.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
3 POD Errors
The following errors were encountered while parsing the POD:
- Around line 180:
=back without =over
- Around line 192:
Expected text after =item, not a bullet
- Around line 212:
You forgot a '=back' before '=head2'