Comments (6)
Sure, but keep in mind I'm just another Nebraska dude:
https://xkcd.com/2347/
from ctpg.
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.
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.
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.
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.
Okay thank you, are there plans to upgrade to C++20 at any time?
from ctpg.
Related Issues (20)
- Can you explain how to use the lexer stand-alone? HOT 5
- Make tests and examples executables conditional HOT 6
- Constexpr parsing: non-constexpr containers HOT 5
- Parsing exponent notation in json-parser HOT 3
- Ignore all whitespaces but newlines HOT 3
- string_view buffer HOT 2
- [question] Cant Parameterize and "Seperate out" Parser HOT 7
- [question] Trouble Making Argument Lists HOT 1
- [Question] Is it applicable to parsing markdown? HOT 2
- [Question] Did I exceed the maximum number of rules? HOT 1
- Precedence When Matching/Lexing HOT 2
- [Feture Request] Integration with CTRE HOT 3
- how long to next release ? HOT 8
- Maybe it is possible that removing lexer scanner? HOT 2
- Big Parsers? HOT 1
- Constexpr parsing of an array of ints HOT 6
- [Question] how to make the lexer NOT match a particular string HOT 2
- [question solved] constexpr variable 'p' must be initialized by a constant expression HOT 1
- Simple expression example and AST HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctpg.