Re: Parser Tree or AST tree for Qi
Nikita Kniazev <[email protected]> Wed, 29 Apr 2015 01:44:08 +0300
| Newsgroups | gmane.comp.parsers.spirit.devel |
|---|---|
| Message-ID | <CAPFiOxazFC2b-g1wojFeBj2_T0Nyz5DmwxELAoJtf+2aV=9=ng@mail.gmail.com> |
--===============8433975290024789378== Content-Type: multipart/alternative; boundary=001a113fde04b5187c0514d09980 --001a113fde04b5187c0514d09980 Content-Type: text/plain; charset=UTF-8 Take a look at utree. You can find info about it here: 1) http://www.boost.org/doc/libs/1_58_0/libs/spirit/doc/html/spirit/support/utree.html 2) http://boost-spirit.com/home/2011/06/12/ast-construction-with-the-universal-tree/ 2015-04-29 1:30 GMT+03:00 YiQing Yang <[email protected]>: > Hi, > > > > I need to create a parser for a SQL like query language. The end result > after parsing needs to be an expression tree with operators and operands to > describe the query using our own expression tree library. > > > > It seems to me that I can't take advantage of the convenient features > provided by Semantic Action to do this, as the children nodes will be > created earlier than the parent node if the nodes creation is executed by > the semantic actions, but the expression tree has to be built from top > down. Looks like I should use the Parser tree or AST tree to accomplish > this. > > > > But it seems that the Parser tree is only available in Spirit Classic. Is there parser tree api available with the Qi parser grammar? > > > > Thanks, > > > > Yiqing > > > > > > > ------------------------------------------------------------------------------ > One dashboard for servers and applications across Physical-Virtual-Cloud > Widest out-of-the-box monitoring support with 50+ applications > Performance metrics, stats and reports that give you Actionable Insights > Deep dive visibility with transaction tracing using APM Insight. > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y > _______________________________________________ > Spirit-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/spirit-devel > > --001a113fde04b5187c0514d09980 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Take a look at utree. You can find info about it here:<div= >1) <a href=3D"http://www.boost.org/doc/libs/1_58_0/libs/spirit/doc/html/sp= irit/support/utree.html">http://www.boost.org/doc/libs/1_58_0/libs/spirit/d= oc/html/spirit/support/utree.html</a></div><div>2) <a href=3D"http://boost-= spirit.com/home/2011/06/12/ast-construction-with-the-universal-tree/">http:= //boost-spirit.com/home/2011/06/12/ast-construction-with-the-universal-tree= /</a><br></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quo= te">2015-04-29 1:30 GMT+03:00 YiQing Yang <span dir=3D"ltr"><<a href=3D"= mailto:[email protected]" target=3D"_blank">[email protected]</a>= ></span>:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e= x;border-left:1px #ccc solid;padding-left:1ex"> <div lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72"> <div> <div style=3D"border:none;border-left:solid #e5e5e5 1.0pt;padding:0in 0in 0= in 11.0pt;background:white"> <p class=3D"MsoNormal" style=3D"line-height:13.5pt;background:white;vertica= l-align:baseline;border:none;padding:0in"> <span style=3D"font-size:10.0pt;font-family:"Courier New";color:#= 555555">Hi,<u></u><u></u></span></p> <p class=3D"MsoNormal" style=3D"line-height:13.5pt;background:white;vertica= l-align:baseline;border:none;padding:0in"> <span style=3D"font-size:10.0pt;font-family:"Courier New";color:#= 555555"><u></u>=C2=A0<u></u></span></p> <p class=3D"MsoNormal" style=3D"line-height:13.5pt;background:white;vertica= l-align:baseline;border:none;padding:0in"> <span style=3D"font-size:10.0pt;font-family:"Courier New";color:#= 555555">I need to create a parser for a SQL like query language. The end re= sult after parsing needs to be an expression tree with operators and operan= ds to describe the query using our own expression tree library.<u></u><u></u></span></p> <p class=3D"MsoNormal" style=3D"line-height:13.5pt;background:white;vertica= l-align:baseline;border:none;padding:0in"> <span style=3D"font-size:10.0pt;font-family:"Courier New";color:#= 555555"><u></u>=C2=A0<u></u></span></p> <p class=3D"MsoNormal" style=3D"line-height:13.5pt;background:white;vertica= l-align:baseline;border:none;padding:0in"> <span style=3D"font-size:10.0pt;font-family:"Courier New";color:#= 555555">It seems to me that I can't take advantage of the convenient fe= atures provided by Semantic Action to do this, as the children nodes will b= e created earlier than the parent node if the nodes creation is executed by the semantic actions, but the expression tree has = to be built from top down. Looks like I should use the Parser tree or AST t= ree to accomplish this. <u></u><u></u></span></p> <p class=3D"MsoNormal" style=3D"line-height:13.5pt;background:white;vertica= l-align:baseline;border:none;padding:0in"> <span style=3D"font-size:10.0pt;font-family:"Courier New";color:#= 555555"><u></u>=C2=A0<u></u></span></p> <pre style=3D"line-height:13.5pt;background:white;vertical-align:baseline;b= order:none;padding:0in"><span style=3D"color:#555555">But it seems that the= Parser tree is only available in Spirit Classic. Is there parser tree api = available with the Qi parser grammar?<u></u><u></u></span></pre> <pre style=3D"line-height:13.5pt;background:white;vertical-align:baseline;b= order:none;padding:0in"><span style=3D"color:#555555"><u></u>=C2=A0<u></u><= /span></pre> <pre style=3D"line-height:13.5pt;background:white;vertical-align:baseline;b= order:none;padding:0in"><span style=3D"color:#555555">Thanks,<span class=3D= "HOEnZb"><font color=3D"#888888"><u></u><u></u></font></span></span></pre><= span class=3D"HOEnZb"><font color=3D"#888888"> <pre style=3D"line-height:13.5pt;background:white;vertical-align:baseline;b= order:none;padding:0in"><span style=3D"color:#555555"><u></u>=C2=A0<u></u><= /span></pre> <pre style=3D"line-height:13.5pt;background:white;vertical-align:baseline;b= order:none;padding:0in"><span style=3D"color:#555555">Yiqing<u></u><u></u><= /span></pre> <p class=3D"MsoNormal" style=3D"line-height:13.5pt;background:white;vertica= l-align:baseline;border:none;padding:0in"> <span style=3D"font-size:10.0pt;font-family:"Courier New";color:#= 555555"><u></u>=C2=A0<u></u></span></p> </font></span></div> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> </div> <br>-----------------------------------------------------------------------= -------<br> One dashboard for servers and applications across Physical-Virtual-Cloud<br= > Widest out-of-the-box monitoring support with 50+ applications<br> Performance metrics, stats and reports that give you Actionable Insights<br= > Deep dive visibility with transaction tracing using APM Insight.<br> <a href=3D"http://ad.doubleclick.net/ddm/clk/290420510;117567292;y" target= =3D"_blank">http://ad.doubleclick.net/ddm/clk/290420510;117567292;y</a><br>= _______________________________________________<br> Spirit-devel mailing list<br> <a href=3D"mailto:[email protected]">[email protected]= urceforge.net</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/spirit-devel" targe= t=3D"_blank">https://lists.sourceforge.net/lists/listinfo/spirit-devel</a><= br> <br></blockquote></div><br></div> --001a113fde04b5187c0514d09980-- --===============8433975290024789378== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y --===============8433975290024789378== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Spirit-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/spirit-devel --===============8433975290024789378==--