lil-lila / packcc Goto Github PK
View Code? Open in Web Editor NEWImplementation of Packrat Parser Generator algorithm
License: MIT License
Implementation of Packrat Parser Generator algorithm
License: MIT License
Repetition of rule in parentheses is handled incorrectly. Rule rule <- A (A B C)*
succeeds even if only A A B
or A A
was matched
Hello,
I'd like to ask if this parser generator supports unicode in character classes? From my testing so far it seems that unicode escapes (e.g. \u1234
) work fine in strings (at least for UTF-8 encoding), but if I use it in character class, it generates wrong code.
For example, if my grammar contains rule TEST <- [\u1234]
, this is generated:
static pcc_thunk_chunk_t *pcc_evaluate_rule_TEST(pkotlin_context_t *ctx) {
pcc_thunk_chunk_t *chunk = pcc_thunk_chunk__create(ctx->auxil);
chunk->pos = ctx->pos;
{
char c;
if (pcc_refill_buffer(ctx, 1) < 1) goto L0000;
c = ctx->buffer.buf[ctx->pos];
if (!(
c == '\xe1' ||
c == '\x88' ||
c == '\xb4'
)) goto L0000;
ctx->pos++;
}
return chunk;
L0000:;
pcc_thunk_chunk__destroy(ctx->auxil, chunk);
return NULL;
}
It looks like the character class specification is passed to unescape_string
function and the matching is done on the bytes it returns (because E1 88 B4
is UTF-8 hex representation of \u1234
).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.