Hello,

As I mentioned in the last mail, I have been working on this
<http://souptonuts.sourceforge.net/readme_lemon_tutorial.html> simple
calculator lemon parser, trying to have a better understanding of how lemon
works and what are the key components when you build one. This example
shows in an incremental manner how to define and specify token type, how to
implement precedence of the operators, add header files, create a simple
grammar and basically all you need to know to make one.

As I posted a few weeks back, there is also this
<https://github.com/tokuhirom/re2c-lemon-tutorial> awesome thing which uses
a lemon parser and a re2c lexer which I have modified to also print the
results. I tried to change its grammar to parse some simple .csg functions
like group() or multimatrix() and it corectly identified them but I run
into some errors which I could not solve at that time. My problem was then
integrating it into BRL-CAD, which Cliff helped me a few days ago .

So far, I have noticed the following aspects. Lemon documentation is slim
and the examples are scarce. Those in the first link are (mostly) broken
and I spent a good deal of time fixing what was supposed to be working. I'm
certainly not backing down from this challenge. The way I see it, it would
be useful to choose Lemon over self-developed parser in case the extension
to .scad would be easier. I know we're one week in the coding period and
I'm still stuck and I'm self-pressured about getting things going. So,

pro's

Lemon - less code, probably easier migration  from .csg to .scad
self-developed parser - easier to write/progress, easier to understand (no
parser knowledge required, just C++)

con's

Lemon - lack of documentation, difficult to get going/integrate
self-developed parser - more code, chance of bad design(because of my lack
of OOP design experience), might be more difficult to extend to .scad?(not
sure)

I feel like I m already running late so whichever we choose, I'll stick to
it on a "win or die trying approach".

Any thoughts?

Andrei

On Wed, May 27, 2015 at 2:49 AM, Ilinca Andrei <andrei.ilinc...@gmail.com>
wrote:

> Hello,
>
> Firstly, thank you, Cliff, for you help with that csg integration patch,
> it really got disappointing not managing to make it work for so long. I
> added it to my svn copy and it compiled perfectly.
>
> Secondly, as Sean recommended, I started building a simple mathematical
> lemon parser in a incremental way, following this tutorial
> <http://souptonuts.sourceforge.net/readme_lemon_tutorial.html> . I'm 2/5
> done with it and I hope I will have it completed by tomorrow.
>
> I believe my initial, working, parsing patch should successfully read any
> .csg file and just print the tokens found. Does this sound fit? On this
> note, It will probably take longer to submit a patch request as anything
> below that could not and should not be integrated into BRL-CAD. If you
> consider I should submit this mathy parser aswell, just let me know.
>
> Best regards,
> Andrei
>
> On Tue, May 26, 2015 at 2:02 AM, Clifford Yapp <cliffy...@gmail.com>
> wrote:
>
>> Andrei,
>>
>> Since the perplex/re2c/lemon setup is a bit obtuse from a build system
>> perspective (which is my fault primarily) I've taken your patch and
>> adapted it to give you what should be a minimal working setup.  The
>> attached patch, applied to the top level of a clean BRL-CAD trunk
>> checkout, should result in a src/conv/csg setup that will build.
>> Applying it to a tree with your existing csg work won't work - it must
>> be applied to a clean checkout.  Study it carefully to see if it makes
>> sense, and note the changes I made to the CMakeLists.txt file and the
>> perplex/lemon inputs.  If you want to see the details of what commands
>> it is running to build the various intermediate files,  use make
>> VERBOSE=1 to build.
>>
>> >From this starting point, if you want to pursue this approach a bit
>> further, the next step is to make this do something simple.  I haven't
>> altered any of the logic - this is just to try to get you over the
>> build system hurdles and started with the important bit - the csg
>> logic. Don't try to preserve all the complexities of what is in the
>> perplex and lemon files now.  Sean's suggestion of a simple adder
>> would be a good starting point.
>>
>> CY
>>
>>
>> ------------------------------------------------------------------------------
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>> _______________________________________________
>> BRL-CAD Developer mailing list
>> brlcad-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>
>>
>
------------------------------------------------------------------------------
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to