[mercury-users] Mercury integration into existing C/C++ application

Julien Fischer juliensf at cs.mu.OZ.AU
Thu Mar 10 09:25:52 AEDT 2005


On Wed, 9 Mar 2005, Alvin Beach wrote:

> Hello all,
>
> I am currently working on a project that requires implementing several rules.
> The rules are simple enough that I could implement them myself, but
> maintaining the code could become very time consuming if/when I modify, add
> and remove rules. My first instinct was to look into Lex (flex) but it
> requires my project to link to the flex library.
>
> This has lead me to search for a state machine generator or as logic
> progamming system (Mercury) that can be integrated into the project without
> having to link to any external libraries. By integrate I mean, the logic
> system would generate the necessary .o and .h that could then be used by my
> project.
>
> I have read through the Mercury Tutorial by Ralph Becket as well as looked
> through the Mercury User's Guide. Both are excellently written but I could
> not determine how I could call the compiled Mercury C object code from within
> my project?
>

The foreign language interface itself is documented in the reference
manual.  The Mercury distribution includes some examples of how to
call Mercury code from C/C++ in the samples/c_interface directory
directory.  (Despite the name it also includes examples of how to call
Mercury code from C++ and Fortran).

Julien.

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list