Comments (8)
Why would you do this? It is the same term.
from ctpg.
There isn't much to release really. I'm sort of waiting until there are some good ideas on how to improve the library.
from ctpg.
Why would you do this? It is the same term.
for recognize following:
int : "[0-9]+" and float : "[0-9]+\.[0-9]+"
or
float self " [0-9]\\.[0-9]+[Ee]-?[0-9]+ | [0-9]+[Ee]-?[0-9]+ | [0-9]+\\.[0-9]+"
or
class "[A-Z][a-zA-Z0-9_]+" and class_ptr "[A-Z][a-zA-Z0-9_]+\*"
and so on.
place them in terms will be an error.
from ctpg.
@peter-winter placing some string(eg: "except", "match", "while") in terms also will be an error.
from ctpg.
Can you please provide some code which isn't working?
from ctpg.
Can you please provide some code which isn't working?
Might I writen mistake. the error of string cannot be reappeared and has been deleted due to finding a new lib(https://github.com/metthal/pog). the following is the code of regex error:
#include <ctpg/ctpg.hpp>
#include <iostream>
#include <charconv>
using namespace ctpg;
using namespace ctpg::buffers;
constexpr nterm<int> list("list");
constexpr char number_pattern[] = "[0-9]+\\.[0-9]+[Ee]-?[0-9]+|[0-9]+[Ee]-?[0-9]+";
constexpr regex_term<number_pattern> number("number");
constexpr parser p(
list,
terms(
number
),
nterms(
list
),
rules(
list(number) >= [](const auto& n) {
return 0;
}
)
);
int main(int argc, char* argv[])
{
if (argc < 2)
return -1;
auto res = p.parse(string_buffer(argv[1]), std::cerr);
bool success = res.has_value();
if (success)
std::cout << res.value() << std::endl;
return success ? 0 : -1;
}
from ctpg.
Maybe the function of mode switcher need to be added also.
from ctpg.
I know you closed it, but actually you were encountering a bug which I just fixed. The problem was with regexes of the form:
a*b|a*
a+b|a+
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
- 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
- [MSVC] Compilation error, unable to resolve operator overload of `ctpg::stdex::cbitset<N>::operator==` HOT 6
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.