You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(This is an umbrella issue to keep all the related information kinda-sorta organized, and allow removing most of the notes from the source.)
Currently disabled; it only made the code more complex and less readable, with all the #ifdefs etc. :-/
Should copy it over to a separate branch and mature it out, if at all possible, and free the main branch from its burden.
COPYLESS_GRAMMAR for empty rules! The problem is that unlike all the other objects that we just reference in this mode, an empty rule is actually a non-empty PROD vector that we need to create ourselves... somehow...
A static obj could kinda do, if my ctors could be made constexpr, but std::vector itself is dynamically allocated anyway, and isn't constexpr, I guess...
The COPYLESS_GRAMMAR API flavor should refuse to take rvalue objects!
From the header comment, FTR:
!!DO NOT USE THIS:
- #define COPYLESS_GRAMMAR to avoid copying the grammar rules, in case the
life-cycle management of the source objects is of no concern. (Albeit the
COPYLESS setup API should refuse to take rvalue objects!)
Alas, it doesn't really work:
a) The PRODUCTION constructs are std::vectors, which do copy whatever we put in there...
b) There's no sane way to define the grammar rules directly using C++ code without a
plethora of temporaries (to copy)...
c) And grammars are not very big anyway, so... (It just felt so bad, in general, e.g.
for heap fragmentation and the churning of dozens of tiny temporary vectors...)
I seem to have implemented COPYLESS_GRAMMAR for nothing! :)
Move-construction should be the way to go...
The text was updated successfully, but these errors were encountered:
(This is an umbrella issue to keep all the related information kinda-sorta organized, and allow removing most of the notes from the source.)
Currently disabled; it only made the code more complex and less readable, with all the
#ifdef
s etc. :-/Should copy it over to a separate branch and mature it out, if at all possible, and free the main branch from its burden.
COPYLESS_GRAMMAR for empty rules! The problem is that unlike all the other objects that we just reference in this mode, an empty rule is actually a non-empty PROD
vector
that we need to create ourselves... somehow...A static obj could kinda do, if my ctors could be made
constexpr
, but std::vector itself is dynamically allocated anyway, and isn'tconstexpr
, I guess...The COPYLESS_GRAMMAR API flavor should refuse to take rvalue objects!
From the header comment, FTR:
The text was updated successfully, but these errors were encountered: