Comments in SQL

24 views
Skip to first unread message

Zeev Atlas

unread,
Jan 7, 2015, 10:11:32 PM1/7/15
to marpa-...@googlegroups.com
I had a chance to feed some SQL statements of varied complexity to MarpaX::Languages::SQL2003::AST.  I do not yet look into error capturing, so all the SQL statements that I use are absolutely valid.  My current task is to review and understand the produced XML.
I've noticed that while the parser recognizes comments as such and correctly ignores them, it does not produce them in the XML output.  Would it be that hard to produce a valid XML comment:
<!-- My comment within SQL statement -->
Or is that already a supported option?
Thanks
ZA

Durand Jean-Damien

unread,
Jan 8, 2015, 12:52:10 AM1/8/15
to marpa-...@googlegroups.com
Zeev,

Comments is an orthogonal rule, that have no place in the BNF except in the discarded thing, and per def discarded things are not part of the final AST.
In conclusion, this is not supported.

Regards, Jean-Damien.

Zeev Atlas

unread,
Jan 8, 2015, 8:56:08 AM1/8/15
to marpa-...@googlegroups.com
Could they be discarded into some bucket with position and length associated and than I can access that bucket and deal with it ?  :)
ZA

Jeffrey Kegler

unread,
Jan 8, 2015, 2:30:33 PM1/8/15
to Marpa Parser Mailing LIst
Jean-Damien and I are now chatting on IRC about a Marpa::R2 extension that might make it easier for him to allow comments, etc., in the AST, without rewriting his grammar.

--
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 marpa-parser...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages