Re: Composing grammars

Baptiste Wicht <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general
signature.asc (application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJWtEs7AAoJEMVWa2x/iEUyF0IP/1qU+r8X4hMggOeuRxuPWf+y
jTsxmq+oasn6VzhzubNiV/RxSqJtqsLJz6yHobzwp0ky9az5v1ynzLQ21yXpEvwt
LSvN0ZDFNTKc8iKuoVms2/M3W3APYXnGUOaTPKlNGRih5eCrlxTHeeiSYDx5HAqV
xB2dIkLjBcjt3/lg5aKcLwSevygdikAlivvmjZS5pHZwXlI6vMEGUNjZz13QZDFA
tel3zOot/igMSSR3qYj4Y87NvSEvsfaseXqE/3aMuvznVSEK4VckrS0/dEdh7HRj
babJ85H87HgLqsh6Vbmd1KA8dYStLv08GK/oTI3E260N1Tys+MXJ4e/cUY4Hlwiw
HxbeTkVI0uQ2eWBaIN3qa/b6YS/pyUCztz3j5BCDbbp4v5sdKVye6K7SUqt0mnQj
o4FhKuYgOm9icDHa9PjdXYz/BSxYLrbveFwZwF1CJZM0DLFtbjzwVrAJxOZG/08r
GaD/WQlzqvgwPnCbP7XxR8qMRWnctiBoUxFXhcxRsGmyxKLogyFo2ZpTi7ENx+ID
1tqmg2yrQjmdmS19flNlBMAsYtL82CCmSU4HPkNPqVNEc/4v/8iL4mFIAG80pCvk
Y2ZJsi7CFYUhGLaTaaydXJyBhf93S+7ukcy4Kn5pLVFuvdbuiQ4ieKJSDd+LJdHO
k259SoeFznZorGBoHRlr
=ZSqS
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.