Lots of progress on the OpenSCAD- compatible parser front, including scope creep!
Benchmarks show this parser is very fast, relative to the original parser, orders of magnitude faster, in some tests.
The command line arguments can now be used to choose which parser to use, and what level of compatibility with OpenSCAD should be used. More will be added as needed.
The alt parser does not fully support ExtOpenscad features, probably. That hasn't been a focus of efforts, yet.
The interpreter has received several changes that will help with future enhancements. Changes to the for loop support a superset of the previous behavior, and the same with echo statements and named parameters.
The request: I would like to build up a library of files to test against. I'm looking for files that work in implicitcad, especially, because thingiverse.com has only a dozen or so. This will really help to ensure compatibility and performance in the new parser. Please share any helpful links or scad scripts!
Feel free to grab the source, check it out, and offer advice or criticism!
The updated plan and status on the wiki:
https://github.com/Cookshak/ImplicitCAD/wiki/Plan
Cheers,
Kelvin
I've made some progress in writing a new expression parser for ExtOpenscad.
It seems pretty quick, and I've expanded the suite of tests Julia wrote for the parser. I hope to have it parsing expressions fully within a week or so.I've added some thoughts to the wiki on my clone of the repo:
https://github.com/Cookshak/ImplicitCAD/wiki/PlanI haven't checked in the lines that make statement and tests use the new parser, which I realize I should do tonight.
The parser is predictive and does not do backtracking, making it fast for large expressions.
All comments are welcome and appreciated.
Cheers,
KelvinOn Jul 16, 2016 11:51 AM, "Kelvin Cookshaw" <kel...@cookshaw.com> wrote:Compatibility with OpenSCAD is the feature that got me interested in ImplicitCAD, and this may have also hooked some others in. It's ability to quickly process my existing SCAD files is pretty important to me.I'm finding the parsing of some files to be quite slow, possibly due to the extensive use of 'try' to perform look ahead in expressions. It seems like large expressions throw it for a loop, but I haven't benchmarked expressions of different depths.Also, I've found quite a few SCAD files I've downloaded do not parse at all, and the parser message is usually not very specific. For example, the parser cannot parse a ternary operator that starts with a comparison, like this: a < b ? 3 : 4I would like ImplicitCAD to be able to quickly parse the entire set of OpenSCAD-compatible files, and provide helpful error messages when it doesn't support a feature, or when there is a syntax error in the source.On the other hand, changing the existing parser to recognize all OpenSCAD files might break some files written specifically for ImplicitCAD, which will never be opened in OpenSCAD.Here's what I would like to propose:a. Continue to support the existing parser as the default;b. Write a new parser, faster and 100% compatible with OpenSCAD;c. Provide a command line argument or a separate executable to choose the newer parser.Is this plan acceptable or of interest to people here? I would like to do this, but I want to know what everybody else thinks.Thanks for your time,Kelvin