Composing grammars

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Composing grammars

Federico Bergero
Hi I wrote a whole parser into one grammar. Everything is working fine
but the compilation time and memory consumption is excessive.

I want to split the grammar into many grammars and compile them separately.
I was able to write and compile one grammar but I cannot get to
use this grammar into another grammar.

Is there a working example online on this subject?

Thanks
Fede

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Composing grammars

Baptiste Wicht
On Thu, Feb 04, 2016 at 04:17:54PM -0300, Federico Bergero wrote:
> Hi I wrote a whole parser into one grammar. Everything is working fine
> but the compilation time and memory consumption is excessive.
>
> I want to split the grammar into many grammars and compile them separately.
> I was able to write and compile one grammar but I cannot get to
> use this grammar into another grammar.
>
> Is there a working example online on this subject?

You can take a look at the calc8 that uses two grammars:
https://github.com/boostorg/spirit/tree/master/example/qi/compiler_tutorial/calc8

The mini_c examples uses several grammars as well:
https://github.com/boostorg/spirit/tree/master/example/qi/compiler_tutorial/mini_c

By the way, if you are starting a new grammar now, you can also take a
look at X3 which should help with your memory and compilation issues.

There are also examples online:
https://github.com/boostorg/spirit/tree/master/example/x3

Best

Baptiste

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

attachment0 (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Composing grammars

Federico Bergero
Great. I'll have a look at X3. I have two questions:
* How can I do the same grammar composition if the grammars
constructor takes an iterator as a parameter (for position tracking in
error handling).

* Would the X3 version compile on older boost versions 1.54 and 1.58?

Thanks!
Fede

On Fri, Feb 5, 2016 at 4:11 AM, Baptiste Wicht <[hidden email]> wrote:

> On Thu, Feb 04, 2016 at 04:17:54PM -0300, Federico Bergero wrote:
>> Hi I wrote a whole parser into one grammar. Everything is working fine
>> but the compilation time and memory consumption is excessive.
>>
>> I want to split the grammar into many grammars and compile them separately.
>> I was able to write and compile one grammar but I cannot get to
>> use this grammar into another grammar.
>>
>> Is there a working example online on this subject?
>
> You can take a look at the calc8 that uses two grammars:
> https://github.com/boostorg/spirit/tree/master/example/qi/compiler_tutorial/calc8
>
> The mini_c examples uses several grammars as well:
> https://github.com/boostorg/spirit/tree/master/example/qi/compiler_tutorial/mini_c
>
> By the way, if you are starting a new grammar now, you can also take a
> look at X3 which should help with your memory and compilation issues.
>
> There are also examples online:
> https://github.com/boostorg/spirit/tree/master/example/x3
>
> Best
>
> Baptiste
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> Spirit-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/spirit-general
>

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general