Is it possible to build a interactive C shell?

℡╲_俬逩灬. 提交于 2019-12-03 05:51:41

问题


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


回答1:


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.




回答2:


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.




回答3:


c-repl should fit the bill.



来源:https://stackoverflow.com/questions/3775674/is-it-possible-to-build-a-interactive-c-shell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!