Horrible compiletimes and memory usage while compiling a parser with X3
Exagon <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
I am currently implementing expressions and the operator hierarchy for my
DSL, using boost spirit X3.
I think my parser is semanticaly correct, but when I try to compile it,
while compiling, gcc and clang having HUGE memory footprint, compiles for an
infinite amount of time, and then quits with "g++: internal compiler error:
Killed (program cc1plus)".
I tried to minimize the code arround the expression parser, but its somehow
not that trivial.
Here <http://melpon.org/wandbox/permlink/8J3DNGd8xDy2v6Eo> is an example
of what causes the compiler error. I dont know if this is a bug, or if I
have a semantic bug in my code, or if this is a bug.
I think the problem is somwhere there:
auto const idx = as<ast::Operation>(helper::idxaccess_op > expression >
']');
auto const func = as<ast::Operation>(helper::func_call_op >
expression%',' > ')');
auto const data = as<ast::Operation>(helper::access_op > expression);
auto const func_call_expr_def =
primary_expr >> *(idx|func|data);
if I change (idx|func|data) to (idx|func), it also compiles forever and uses
up to 16GB of ram, but gcc is able to compile it, and the parser works how
it should work.
Thanks
Exagon
--
View this message in context: http://boost.2283326.n4.nabble.com/Horrible-compiletimes-and-memory-usage-while-compiling-a-parser-with-X3-tp4689104.html
Sent from the spirit-general mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot