2020-08-30 00:25:41 +02:00
|
|
|
// The Construct
|
2018-02-04 03:22:01 +01:00
|
|
|
//
|
2020-08-30 00:25:41 +02:00
|
|
|
// Copyright (C) The Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2020 Jason Volk <jason@zemos.net>
|
2018-02-04 03:22:01 +01:00
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
2017-03-16 21:35:37 +01:00
|
|
|
|
2019-04-21 00:41:11 +02:00
|
|
|
#ifndef HAVE_IRCD_SPIRIT_H
|
2017-09-21 04:31:54 +02:00
|
|
|
#define HAVE_IRCD_SPIRIT_H
|
|
|
|
|
|
|
|
/// This file is not part of the IRCd standard include list (stdinc.h) because
|
|
|
|
/// it involves extremely expensive boost headers for creating formal spirit
|
|
|
|
/// grammars. Include this in a definition file which defines such grammars.
|
2019-05-06 19:38:37 +02:00
|
|
|
///
|
|
|
|
/// Note that directly sharing elements of a grammar between two compilation
|
|
|
|
/// units can be achieved with forward declarations in `ircd/grammar.h`.
|
2017-09-21 04:31:54 +02:00
|
|
|
|
2019-04-21 00:41:11 +02:00
|
|
|
// ircd.h is included here so that it can be compiled into this header. Then
|
|
|
|
// this becomes the single leading precompiled header.
|
|
|
|
#include <ircd/ircd.h>
|
|
|
|
|
2020-02-27 20:54:47 +01:00
|
|
|
// Disables asserts in spirit headers even when we're NDEBUG due to
|
|
|
|
// some false asserts around boolean character tests in spirit.
|
|
|
|
#define BOOST_DISABLE_ASSERTS
|
|
|
|
|
2020-07-25 07:09:19 +02:00
|
|
|
// This prevents spirit grammar rules from generating a very large and/or deep
|
|
|
|
// call-graph where rules compose together using wrapped indirect calls through
|
|
|
|
// boost::function -- this is higly inefficient as the grammar's logic ends up
|
|
|
|
// being a fraction of the generated code and the rest is invocation related
|
|
|
|
// overhead. By force-flattening here we can allow each entry-point into
|
|
|
|
// spirit to compose rules at once and eliminate the wrapping complex.
|
|
|
|
#pragma clang attribute push ([[gnu::always_inline]], apply_to = function)
|
|
|
|
#pragma clang attribute push ([[gnu::flatten]], apply_to = function)
|
|
|
|
|
2020-02-26 03:54:01 +01:00
|
|
|
#include <boost/config.hpp>
|
|
|
|
#include <boost/function.hpp>
|
|
|
|
|
2020-07-25 07:09:19 +02:00
|
|
|
#pragma GCC visibility push (internal)
|
2020-09-06 07:58:38 +02:00
|
|
|
|
2020-09-06 10:56:39 +02:00
|
|
|
namespace boost::spirit
|
2020-09-06 07:58:38 +02:00
|
|
|
{
|
|
|
|
using std::function;
|
|
|
|
}
|
|
|
|
|
2020-05-20 01:23:20 +02:00
|
|
|
#include <boost/fusion/sequence.hpp>
|
|
|
|
#include <boost/fusion/iterator.hpp>
|
|
|
|
#include <boost/fusion/adapted.hpp>
|
|
|
|
#include <boost/fusion/functional.hpp>
|
|
|
|
#include <boost/fusion/algorithm.hpp>
|
|
|
|
#include <boost/fusion/include/std_pair.hpp>
|
2017-03-16 21:35:37 +01:00
|
|
|
#include <boost/spirit/include/qi.hpp>
|
|
|
|
#include <boost/spirit/include/karma.hpp>
|
2018-01-18 12:39:19 +01:00
|
|
|
#include <boost/spirit/include/phoenix.hpp>
|
2020-05-13 09:31:56 +02:00
|
|
|
#include <boost/spirit/repository/include/qi_seek.hpp>
|
|
|
|
#include <boost/spirit/repository/include/qi_subrule.hpp>
|
2018-03-17 18:44:40 +01:00
|
|
|
|
2020-09-06 07:58:38 +02:00
|
|
|
#pragma GCC visibility pop
|
2020-07-25 07:09:19 +02:00
|
|
|
#pragma clang attribute pop
|
|
|
|
#pragma clang attribute pop
|
|
|
|
|
2020-08-30 00:25:41 +02:00
|
|
|
#include <ircd/spirit/spirit.h>
|
|
|
|
#include <ircd/spirit/expectation_failure.h>
|
|
|
|
#include <ircd/spirit/parse.h>
|
|
|
|
#include <ircd/spirit/generate.h>
|
2020-06-10 14:29:07 +02:00
|
|
|
|
|
|
|
namespace ircd
|
|
|
|
{
|
|
|
|
using spirit::generate;
|
|
|
|
using spirit::parse;
|
|
|
|
}
|
|
|
|
|
2020-08-30 00:25:41 +02:00
|
|
|
#endif HAVE_IRCD_SPIRIT_H
|