Parser Tree or AST tree for Qi
YiQing Yang <[email protected]> Tue, 28 Apr 2015 22:30:02 +0000
| Newsgroups | gmane.comp.parsers.spirit.devel |
|---|---|
| Message-ID | <CO2PR0801MB677483CD328E2651DD7DFE8DAE80@CO2PR0801MB677.namprd08.prod.outlook.com> |
--===============2163033059546588009==
Content-Language: en-US
Content-Type: multipart/alternative;
boundary="_000_CO2PR0801MB677483CD328E2651DD7DFE8DAE80CO2PR0801MB677na_"
--_000_CO2PR0801MB677483CD328E2651DD7DFE8DAE80CO2PR0801MB677na_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi,
I need to create a parser for a SQL like query language. The end result aft=
er parsing needs to be an expression tree with operators and operands to de=
scribe the query using our own expression tree library.
It seems to me that I can't take advantage of the convenient features provi=
ded by Semantic Action to do this, as the children nodes will be created ea=
rlier than the parent node if the nodes creation is executed by the semanti=
c actions, but the expression tree has to be built from top down. Looks lik=
e 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 t=
here parser tree api available with the Qi parser grammar?
Thanks,
Yiqing
--_000_CO2PR0801MB677483CD328E2651DD7DFE8DAE80CO2PR0801MB677na_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"WordSection1">
<div style=3D"mso-element:para-border-div;border:none;border-left:solid #E5=
E5E5 1.0pt;padding:0in 0in 0in 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,<o:p></o:p></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"><o:p> </o:p></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.<o:p></o:p></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"><o:p> </o:p></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 featur=
es provided by Semantic Action to do this, as the children nodes will be cr=
eated 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.
<o:p></o:p></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"><o:p> </o:p></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?<o:p></o:p></span></pre>
<pre style=3D"line-height:13.5pt;background:white;vertical-align:baseline;b=
order:none;padding:0in"><span style=3D"color:#555555"><o:p> </o:p></sp=
an></pre>
<pre style=3D"line-height:13.5pt;background:white;vertical-align:baseline;b=
order:none;padding:0in"><span style=3D"color:#555555">Thanks,<o:p></o:p></s=
pan></pre>
<pre style=3D"line-height:13.5pt;background:white;vertical-align:baseline;b=
order:none;padding:0in"><span style=3D"color:#555555"><o:p> </o:p></sp=
an></pre>
<pre style=3D"line-height:13.5pt;background:white;vertical-align:baseline;b=
order:none;padding:0in"><span style=3D"color:#555555">Yiqing<o:p></o:p></sp=
an></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"><o:p> </o:p></span></p>
</div>
<p class=3D"MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>
--_000_CO2PR0801MB677483CD328E2651DD7DFE8DAE80CO2PR0801MB677na_--
--===============2163033059546588009==
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
--===============2163033059546588009==
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
--===============2163033059546588009==--