开发者

Is it possible to build a interactive C shell?

开发者 https://www.devze.com 2023-01-17 18:37 出处:网络
I\'m just wondering if this is possible using eit开发者_StackOverflowher (Python, Java or C)? I\'m looking for something like IPython for Python.Yes, and such things already exist, you just have to go

I'm just wondering if this is possible using eit开发者_StackOverflowher (Python, Java or C)? I'm looking for something like IPython for Python.


Yes, and such things already exist, you just have to google for them :-)

  • Ch is one popular example
  • CINT is another

That said, actually developing a functional interpreter like this from scratch is much more difficult than finding one online. So now it depends on what's behind your question - do you want just an interpreter to use? Then pick one of the linked above. Do you want to develop such an interpreter? Well, then start reading.


GDB, or any other debugger such as the ups debugger, will generally implement a subset of C that can be used interactively.

There is also the Ch C interpreter, a commercial C interpreter, and the open source ccons C interpreter, which is based on clang/LLVM.


c-repl should fit the bill.

0

精彩评论

暂无评论...
验证码 换一张
取 消