Enter CLIPS commands from a program

I want to use the CLIPS rules engine in an application.  I will put a GIU front end on it and then pass the assertions and rules to it from the GIU.

Is there any way to programmatically (from c/c++) pass the commands through to CLIPS as if they were being typed into the CLIPS front end?  For example to enter a statement like:
(assert (foo bar))

Open in new window

I know that there is an API for sending assertions, rules, etc. to CLIPS from C++ with statements like this:  
AssertString("(foo bar)");

Open in new window

     
However this requires setting up a different API call for each of the dozens of types of statements.  It would be much simpler to just send the statements to CLIPS as they would be typed into it's front end.

Thank you!
anAppBuilderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
Well, I am not familiar with CLIPS, but I checked http://en.wikipedia.org/wiki/CLIPS and the linked articles. On Windows, you could use the method described in http://www.codeproject.com/Articles/7305/Keyboard-Events-Simulation-using-keybd_event-funct ("Keyboard Events Simulation using keybd_event() function") to send that to CLIPS as if it was user input.
0
anAppBuilderAuthor Commented:
Thank you, jkr.  I held off for a few days to see if there would be any other responses.  I'm really looking for a cross-platform solution.

What is the proper next step?
Award points for this solution and post a separate question for the cross platform question?
Leave this question open?
0
jkrCommented:
Well, that's up to you, but I tend to say that there will not be a cross-platform solution, if I was aware of any, I'd have mentioned it. The closest thing I remember for UN*X platforms would be 'XSendEvent()' (http://www.unix.com/man-page/All/3x/XSendEvent/) - which BTW, has it's Windows 'equivalent' in 'SendInput()' (http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx), which actually supersedes 'keybd_event()'.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anAppBuilderAuthor Commented:
Thank you!
0
sarabandeCommented:
there is a c++ interface for clips called clipsmm.

http://www.ohloh.net/p/clipsmm

use the browse button on that site to see code examples and download.

Sara
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.