Code Monkey home page Code Monkey logo

Comments (6)

peter-winter avatar peter-winter commented on May 22, 2024 1

Sure, but keep in mind I'm just another Nebraska dude:
https://xkcd.com/2347/

from ctpg.

peter-winter avatar peter-winter commented on May 22, 2024

The msvc support is the main time sink in this project. It takes 80% of the time to come up with workarounds just to make things compile. Not sure why the main branch is reporting no issues on github actions in msvc, maybe the compiler is different.

What exactly are you trying to build here?

from ctpg.

moritz-geier avatar moritz-geier commented on May 22, 2024

This is my current code. The error is indicated by the parser object. The goal is to create a parser to parse simple conditions like (5>3)&10>8.8. I tried to implement it on the release branch 1.3.7 but there my regex for floating point ("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?") numbers got me into some trouble, thus i wanted to try out the main branch. The code below is just a simple proof of concept, but it still fails.

///////////////////////////////////////////////////////////////////////////
static constexpr ctpg::nterm<bool> conditionExpression{"condition"};

static constexpr char integerPattern[] = "[-+]?[0-9]+";
static constexpr ctpg::regex_term<integerPattern> integerValue{"integer"};

static constexpr ctpg::char_term trueLiteral{'t'};
static constexpr ctpg::char_term falseLiteral{'f'};

///////////////////////////////////////////////////////////////////////////
static constexpr auto root = conditionExpression;

///////////////////////////////////////////////////////////////////////////
static constexpr auto terminals = ctpg::terms(
    integerValue,
    't',
    'f'
);

///////////////////////////////////////////////////////////////////////////
static constexpr auto nonTerminals = ctpg::nterms(
    conditionExpression
);

///////////////////////////////////////////////////////////////////////////
static constexpr ctpg::parser parser{
    root,
    terminals,
    nonTerminals,
    rules(
        conditionExpression(trueLiteral) >=
            [](const auto&) { return true; },
        conditionExpression(falseLiteral) >=
            [](const auto&) { return false; }
    )
};

from ctpg.

moritz-geier avatar moritz-geier commented on May 22, 2024

Oh, i tried to compile it with GCC, and it says:

ctpg.hpp:2380:42: error: C++20 says that these are ambiguous, even though the second is reversed: [-Werror]
[build]  2380 |                     if (states[i].kernel == kernel)
[build]       |                         ~~~~~~~~~~~~~~~~~^~~~~~~~~

from ctpg.

peter-winter avatar peter-winter commented on May 22, 2024

Oh, you are supposed to use c++17.
I did not work on the project quite a while, making it c++20 is my top priority though.
I am aware there are issues with compilation using c++20

from ctpg.

moritz-geier avatar moritz-geier commented on May 22, 2024

Okay thank you, are there plans to upgrade to C++20 at any time?

from ctpg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.