This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2024 T. Zachary Laine | |
// | |
// Distributed under the Boost Software License, Version 1.0. (See | |
// accompanying file LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
#ifndef BOOST_PARSER_PARSER_HPP | |
#define BOOST_PARSER_PARSER_HPP | |
#include <boost/parser/parser_fwd.hpp> | |
#include <boost/parser/concepts.hpp> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Purpose: | |
// Simplify rule, rule_definition, parse_rule, BOOST_SPIRIT_DEFINE. | |
//References: | |
// [inline] | |
// https://isocpp.org/wiki/faq/inline-functions#where-to-put-inline-keyword | |
// https://stackoverflow.com/questions/3992980/c-inline-member-function-in-cpp-file | |
//=========================================================================== | |
#include "toy_rule_parse_rule.hpp" | |
/////////////////////////////////////////////////////////////////////////////// | |
// test code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//OriginalCode: | |
// http://coliru.stacked-crooked.com/a/d149f05af81bf0cf | |
//WhichWasAnswerTo: | |
// https://stackoverflow.com/questions/45899090/recursive-rule-in-spirit-x3/45900983 | |
//DownloadedOn: | |
// 2020-03-06.0512CST | |
//Modifications: | |
// WHAT: | |
// * added macro, USE_TOP_LEVEL_SKIPPER | |
// * depending on defined(USE_TOP_LEVEL_SKIPPER) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Following code modifies: | |
// https://gist.github.com/cppljevans/0fede2c9c2e57f25712528dab4e6aec7#file-date_parser-rm_as_define-cpp | |
//by: | |
// 1) adding a macro, USE_ALTERNATIVES | |
// 2) using BOOST_FUSION_ADAPT_STRUCT | |
// 3) using rule | |
// 4) using force propagation flag in rule. | |
//to: | |
// show that even with attribute propagation, the attributes will not | |
// propage when there's any ALTERNATIVE's. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Purpose: | |
// Follow Joel's suggestion about changing the | |
// xform_rule attribute to double expressed here: | |
// https://github.com/boostorg/spirit/issues/459#issuecomment-469476231 | |
//Result: | |
// **SAME** result when defined(CALL_RULE_DEFINITION_SPECIALIZATION). | |
// IOW, the wrong value for `attr_rule`. Without this define, | |
// the results are as expected, i.e. `attr_rule` == 1235. | |
// However, that's because, **behind the scenes**, spirit is | |
// making a redundant (i.e. useless) call to the default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*============================================================================= | |
Copyright (c) 2002-2015 Joel de Guzman | |
Distributed under the Boost Software License, Version 1.0. (See accompanying | |
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
=============================================================================*/ | |
/////////////////////////////////////////////////////////////////////////////// | |
// | |
// A parser for arbitrary tuples. This example presents a parser | |
// for an employee structure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-*- mode: compilation; default-directory: "~/prog_dev/boost/releases/ro/boost_1_65_1/sandbox/kojoley/test/" -*- | |
Compilation started at Fri Mar 23 11:20:46 | |
make -k ls | |
ls -ld ../x3-variant-fixes/include/* | |
drwxrwxr-x 3 evansl evansl 4096 Mar 22 19:40 ../x3-variant-fixes/include/boost | |
Compilation finished at Fri Mar 23 11:20:46 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Purpose: | |
// Experiment with different methods for making code here: | |
// https://github.com/Kojoley/spirit/blob/8b76132c8ded0c63b8ecc7d1689627ae49d1fde9/include/boost/spirit/home/x3/operator/detail/sequence.hpp#L419 | |
// a little more modular and help to answer question about | |
// whether to use lamba's as posed by Joel here: | |
// https://github.com/boostorg/spirit/pull/370#issuecomment-369410876 | |
//Result: | |
// Works both when | |
// defined(USE_CONSTEXPR_IF_LAMBDA) | |
// and when |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Purpose: | |
// Illustrate the workings of the create_window code found in attachment to: | |
/* | |
https://groups.google.com/a/isocpp.org/forum/?utm_medium=email&utm_source=footer#!msg/std-proposals/b1X597zMx9s/4fnQB6gBCwAJ | |
*/ | |
//Modifications: | |
// Renamed create_window to named_args and renamed many other | |
// types and variables to make them more generic or readable. | |
// Added several comments explaining purpose of various parts. | |
// Added extensive print statements to illustrate how code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Purpose: | |
// Demonstrate the purpose BOOST_SPIRIT_DEFINE | |
// is to implement recursive rules. | |
//OriginalSource: | |
// https://github.com/boostorg/spirit/blob/develop/workbench/x3/toy/toy.cpp | |
//Modifications: | |
// Rm'ed use of context to implement recursiion and replaced with | |
// BOOST_SPIRIT_DEFINE | |
//=========================================================================== | |
#include <iostream> |
NewerOlder