Is anyone aware of a Pascal interpreter/compiler which is embeddable in C++ (or anything else other than Pascal) applications? I am cloning (for lack of a better word) an application which uses an Object-Pascal compatible scripting language and needs to be script compatible. Am I going to end up writing an interpreter? (!)
-
So, do you want the Pascal to execute as a runtime script (like a Visual Basic script) or as a compiled library (DLL or .so) that is dynamically loaded, plugin-style? I.e. are you wanting to interpret Pascal at runtime (like Tcl or Scheme), or compile it and execute the binary? – Mike DeSimone Mar 24 '10 at 02:04
6 Answers
There's RemObjects Pascal Script. You can probably call it from C++ Builder.
Pascal Script is a free scripting engine that allows you to use most of the Object Pascal language within your Delphi or Free Pascal projects at runtime.
There's also TMS Scripter Studio.
By building scripting support into your applications, you can provide a high degree of configurability, flexibility and automation control in your applications.

- 94,654
- 45
- 215
- 319
I think the question is about interpreter/compiler of a language for application user to program and run, if it is the case I may suggest Lua or Pascal Script. Sorry for lack of links, but points are required for that.
EDIT: Fixed links and Lua spelling

- 3,009
- 4
- 37
- 51
PaxCompiler can be embedded in C++ Builder. More info at http://www.paxcompiler.com.

- 3,690
- 19
- 19
NIH Image had a pascal like embedded language. Don't know if it is available, easily extractable, or useful for your purposes.

- 98,632
- 24
- 142
- 234
The Free Pascal compiler supports Object Pascal and it says you can call a Pascal library from a C program. With luck this will be as good as embedding.
That what you're looking for? (If not, you can translate Standard Pascal to C with
p2c
, a Pascal-to-C translator that is available from Debian, among other places. But having used p2c
, I can't recommend it, and I don't think it understands Object Pascal.)

- 198,648
- 61
- 360
- 533
-
Not even close! Note that FPC is mostly GCC callable. If it is callable from other C compilers depends on their abilities – Marco van de Voort Apr 09 '10 at 21:36
https://github.com/BenLand100/CPascal
You can extend it for what ever you are trying to build.

- 159
- 1
- 8