Since the SQL topic got a revival I have reworked the grammar..

   - Now the AST in in the XML format (XML::LibXML thingy), as in the 
   example in attachement which is the AST of "select * from myTable;'.
   - The reworked grammar is in the __DATA__ section of 
   lib/MarpaX/Languages/SQL/AST/Grammar/ISO_IEC_9075_2_2003.pm 
   
<https://github.com/jddurand/MarpaX-Languages-SQL-AST/blob/master/lib/MarpaX/Languages/SQL/AST/Grammar/ISO_IEC_9075_2_2003.pm>
   - Please use the example that is in proof_of_concept/synopsis.pl 
   
<https://github.com/jddurand/MarpaX-Languages-SQL-AST/blob/master/proof_of_concept/synopsis.pl>
 to 
   reproduce the XML attached to this mail: perl -Ilib 
   proof_of_concept/synopsis.pl

Following a recent discussion on IRC 
<http://irclog.perlgeek.de/marpa/2014-12-07#i_9769809> with Jeffrey, I move 
to G1 a lot of the ambiguities of the SQL grammar and letted Marpa's LATM 
handle them.

Please note that SQL grammar being anyway *highly* ambiguous, my generated 
grammar is systematically executed with 'high_rule_only' ranking method, 
and that 100% of the grammar is (ab)using the rank Marpa facility:, I 
estimated that, alike in the old FLEX files where the lexemes priorities 
were implicit v.s. their appearance in the .lex file content, the rules in 
the SQL grammar have implicit priorities v.s. their appearance in the 
grammar.

Jean-Damien.

Le dimanche 7 décembre 2014 06:36:59 UTC+1, Durand Jean-Damien a écrit :
>
> Hello,
>
> Yes, grammar's defaults are right now:
>
> :default ::= action => [values] bless => ::lhs
> lexeme default = action => [start,length,value] latm => 1
>
> I'll may move to a DOM, optionally, if you prefer.
>
> Le dimanche 7 décembre 2014 03:28:36 UTC+1, Ron Savage a écrit :
>>
>> Could anybody comment about the below specific question and direct me to 
>>> the correct place where to get the information
>>> The object contains these:
>>> sample#1
>>> bless( [
>>>          [
>>>            0,
>>>            6,
>>>            'CREATE'
>>>          ],
>>>          [
>>>            7,
>>>            6,
>>>            'SCHEMA'
>>>          ],
>>> Where can I find the meanings of each of the three elements of the tuple 
>>> (the last one is obvious).
>>>
>>
>>  The output can be controlled by the programmer (i.e. every package can 
>> output a different format), but here I'd say 0 is the offset of the 1st 
>> token, and 6 is its length, while 7 is the offset of the 2nd token, and 6 
>> is its length.
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"marpa parser" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: synopsis.xml
Description: XML document

Reply via email to