Boost logo

Boost Users :

Subject: Re: [Boost-users] [Spirit] Problem with fairly big grammar
From: HT4N - (ht4n_at_[hidden])
Date: 2009-11-09 02:51:01


To be honest I am a little bit confuse with the examples you mentioned. I do not see where the grammar is now defined in the .cpp file from the example. I only see a declaration of grammar in .hpp.

I would have expect that the Grammar header is defined in .hpp but the actual EBNF definition is defined in .cpp. Hence, I do not see example of (2) in the examples, unless I miss something.

 

About your point (1), I think Classic Spirit also support this. You can have a rule that embed a grammar which is defined in a different file.

 
> From: hoeppler_at_[hidden]
> To: boost-users_at_[hidden]
> Date: Sun, 8 Nov 2009 15:33:16 +0100
> Subject: Re: [Boost-users] [Spirit] Problem with fairly big grammar
>
> On Sunday 08 November 2009, Ray Burkholder wrote:
> > > I highly suggest moving to spirit2 if you are planning to do any
> > > refactorization. In spirit2 (http://spirit.sourceforge.net/home/)
> > > we have some examples that highlight this:
> > >
> > > calc6, calc7 and mini_c are examples of modular grammar constructions.
> > > calc6 is simplest of the three and shows how you can:
> > >
> > > 1) embed grammars for modularization
> > > 2) separate the grammar definition (constructor) from the class
> > > declaration
> > > 3) instantiate a particular grammar template in a cpp file.
> >
> > Would you be able to provide a direct link to the calc6, calc7 examples?
> > They don't appear to be directly linked or described on the documentation
> > page at:
> > http://spirit.sourceforge.net/home/spirit2/libs/spirit/doc/html/index.html
>
> http://svn.boost.org/svn/boost/trunk/libs/spirit/example/qi/calc6/
>
> HTH,
> Chris
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
                                               
_________________________________________________________________
Windows 7: Unclutter your desktop.
http://go.microsoft.com/?linkid=9690331&ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009
--_ceac1dbe-0e49-430a-b411-dd8e2d75d5c6_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
To be honest I am a little bit confuse with the examples you mentioned. I&nbsp;do not see where the grammar is&nbsp;now defined in the .cpp file from the example. I only see a declaration of grammar in .hpp.<BR><BR>
I would have expect that&nbsp;the Grammar header is defined in .hpp but the actual EBNF definition is defined in .cpp. Hence, I do not see example of (2) in the examples, unless I miss something.<BR>
&nbsp;<BR>
About your point (1), I think Classic Spirit also&nbsp;support this. You can&nbsp;have a rule that embed a grammar which is defined in a different file.<BR>
<BR>&nbsp;<BR>&gt; From: hoeppler_at_[hidden]<BR>&gt; To: boost-users_at_[hidden]<BR>&gt; Date: Sun, 8 Nov 2009 15:33:16 +0100<BR>&gt; Subject: Re: [Boost-users] [Spirit] Problem with fairly big grammar<BR>&gt; <BR>&gt; On Sunday 08 November 2009, Ray Burkholder wrote:<BR>&gt; &gt; &gt; I highly suggest moving to spirit2 if you are planning to do any<BR>&gt; &gt; &gt; refactorization. In spirit2 (http://spirit.sourceforge.net/home/)<BR>&gt; &gt; &gt; we have some examples that highlight this:<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; calc6, calc7 and mini_c are examples of modular grammar constructions.<BR>&gt; &gt; &gt; calc6 is simplest of the three and shows how you can:<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; 1) embed grammars for modularization<BR>&gt; &gt; &gt; 2) separate the grammar definition (constructor) from the class<BR>&gt; &gt; &gt; declaration<BR>&gt; &gt; &gt; 3) instantiate a particular grammar template in a cpp file.<BR>&gt; &gt;<BR>&gt; &gt; Would you be able to provide a direct link to the calc6, calc7 examples?<BR>&gt; &gt; They don't appear to be directly linked or described on the documentation<BR>&gt; &gt; page at:<BR>&gt; &gt; http://spirit.sourceforge.net/home/spirit2/libs/spirit/doc/html/index.html>&gt; <BR>&gt; http://svn.boost.org/svn/boost/trunk/libs/spirit/example/qi/calc6/>&gt; <BR>&gt; HTH,<BR>&gt; Chris<BR>&gt; _______________________________________________<BR>&gt; Boost-users mailing list<BR>&gt; Boost-users_at_[hidden]<BR>&gt; http://lists.boost.org/mailman/listinfo.cgi/boost-users> <br /><hr />Windows 7: Unclutter your desktop. <a href='http://go.microsoft.com/?linkid=9690331&ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009' target='_new'>Learn more.</a></body>
</html>
--_ceac1dbe-0e49-430a-b411-dd8e2d75d5c6_--


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net