[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 817
  • Last Modified:

small C interpreter


  Hi !

I try to find a small C interpreter, and I want to use it on different platforms. It shouldn't be complex, just for scripting. Target platforms: Palm,Symbian,PC.
Needed functionality:
- basic C keywords
- variables (and linking to outside)
- arithemtic&logical operations
- function calls (not define, just call - link to outside)

a sample C source:
  if(iVar1==2 && (iVar2==3 || bVar1))
     func1();
  else
     func2();
notes:
- it's good if the interpreter gets the variables through my gateway
- the same for functions, with va_arg

  Thanks
    Stewe
0
stewe
Asked:
stewe
1 Solution
 
cupCommented:
Try PocketC.  It is almost the same as C except you can use strings in case statements.  http://www.orbworks.com/

They have versions that work on Palm and Windows CE.  I don't know about Symbian.
0
 
cupCommented:
There are lots of compilers about but not many interpreters.  You could also try the SmallC interpreter from http://www.mirror.ac.uk/collections/hensa-micros/collections/aeres/edsw/d-comlng.htm
0
 
ExceterCommented:
Check this out,
http://eic.sourceforge.net/overview/

Exceter
0
Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

 
steweAuthor Commented:
Thanks, I start to check them.
0
 
steweAuthor Commented:
PocketC: not available for Symbian and no source code
SmallC: the version what I found is full of 8086 assembly... but pretty small.
Eic: a very good one, but too large. I have to port it to Palm & Symbian!

Hmm maybe another language would be good... the primary goal: small, simple, easy to port.

Thanks
0
 
cupCommented:
Have you looked at the other C Compilers on the site?  There is QWIKC and PCC12C.  

Another language: how about Forth?
0
 
steweAuthor Commented:
I need an interpreter, not a compiler! Most of these 'script' C codes will be developed at design time, but can be changed run-time (maybe on the PDA). I don't want to compile and link on the PDA.

Forth is completely a black hole for me ;)
Maybe the basic can be good, if I can't find a good C interpreter. Basic seems to be easier and less complex so it may have more interpreters.

  Stewe
0
 
cupCommented:
What part of the interpreter do you need?  It will normally be

parser
code generation into some intermediate language
execution

That is basically what perl does.  There are quite a few basic interpreters with source but it really depends on what you want to do with it.  Normal OS script languages normally have forms of file and string manipulation and no types.  Basic might be ok for that: it certainly is on DOS.  Found quite a few interpreters on Google but I don't know whether the sources are in C or some weird assembler.

Good luck in your search.
0
 
steweAuthor Commented:

internal structure doesn't matter for me, and it's normally as you mentioned. parser, p-code, run.

my communication software contains many events, which must be customizable. A user might want to override a default event handler on his PDA, and this is the point where a scripting language can be useful. I don't need fast execution...
Look at my example in the first message: an event handler. The script queries some variables, and based on them, calls the right (outer) function. I don't need script functions, arrays, structs,... just logical operation, variable handling, outer function call.

I found some interpreters, just I don't have the time for searching them. As I see, most of them are too complex, with huge source code (200-500K cpp source or more). It would mean that a scripting engine part is larger than current application.

  Stewe
0
 
steweAuthor Commented:

Sorry, guys, I couldn't find a good one. I haven't got more time, so I have to write it. I hope it just means a few days work. I really need a simple one (but stable ;)
Most of them were too complex, or hard to port. Ah yes, and huge source code.

Since I can't delete this question, one of you may receive the points, based on admins. You tried to help, but I can't share these points.

  Stewe
0
 
SpideyModCommented:
Administrative action - PAQ'd and points NOT refunded.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now