ccons Interactive Console for the C Programming Language by Alexei Svitkine Supervised by: Dr. Peter Grogono COMP 490 - Computer Science Project I
Concordia University - Winter 2009
Project Goals Goal is to create an interactive console for C Let user enter C code interactively, line by line, and execute each line as it is entered Similar to interactive consoles that already exist for interpreted languages such as Python and Ruby Would allow C programmers to quickly try out code snippets and can serve as a useful tool for learning C
Libraries Built on top of existing Open Source libraries: LLVM - Low Level Virtual Machine http://llvm.org/
clang - C Language Frontend for LLVM http://clang.llvm.org/
Editline - Command Line Editor Library http://www.thrysoee.dk/editline/
Features - Basics Input C code, which is compiled and executed line by line Expressions are evaluated and the results displayed Can #include header files and call functions Blocks (if statements, loops, etc) are detected and the console goes into multi-line input mode
Features - Functions Support for defining and executing functions ccons detects if the input is a function and treats it as a “top-level” element Functions can then be called - either directly, or from other functions or blocks
Features - Multi-Process In multi-process mode: “front-end” process reads input from the user sends user input over IPC to “back-end” “back-end” process compiles input and executes it If the “back-end” process crashes due to executing bad code, the “front-end” process will restart it
Features - Libraries, Auto-complete, History Lets you dynamically load external libraries using :load command Once loaded, the library’s functions can be called Provides auto-completion for filesystem paths Command history allows you to use UP and DOWN arrows to navigate through your previous input
Automated Tests
Automated tests provide assurance that the system is working correctly Created with the expect UNIX command-line utility Tests specify input to ccons and the expected output Simulate a user who is entering input into the system
Open Source ccons is Free Software Source code is licensed under the MIT License Hosted in a Subversion repository on Google Code http://code.google.com/p/ccons Anyone may download the code, compile it and use the software for any purpose Supports Mac OS X and Linux
Conclusion Interactive console that runs C code that is entered Uses open source libraries: clang, LLVM, Editline Supports line input, block input, defining functions Multi-process mode for robust handling of bad code Automated tests using UNIX expect utility Open source project - supports Mac OS X and Linux
Interactive Console for the C Programming Language ... - GitHub
ccons. Interactive Console for the C. Programming Language. COMP 490 - Computer Science Project I. Concordia University - Winter 2009 by Alexei Svitkine.
A preprocessing step performs macro substitution on program text, inclusion of other .... Chapter 1 is a tutorial on the central part of C. The purpose is to get the ...... As an illustration of some of the bit operators, consider the function getbit
3. The for statement. 4. Symbolic Constants. 5. Character Input and Output. 1. .... assignment or a function call, can be a statement. Pointers provide for .... The only way to learn a new programming language is by writing programs in it. The first
developed, since both the system and most of the programs that run on it are written in C. The language, however, is not tied .... Most can be written in C, and except for the operating system details they conceal, are ... Chapter 7 describes the sta
You'll find a guide to the structure and organization of this book in Chapter 1. ..... Determine US generation name based on birth year ...... curly braces: "360 degrees=#{2*Math::PI} radians" # "360 degrees=6.28318530717959 radians" ...... of comput
School of Information Technology. Halmstad University, Box 823, 30118, ... tween physical wireless networking and virtual ITT networking. Therefore, only one ...
A preprocessing step performs macro substitution on program text, inclusion of ...... if (disaster) ..... The operation of pushing and popping a stack are trivial, but by the time error detection and recovery are added, they are long enough that it i
2. Introduction. Project Motivation. With the technology industry developing at a rapid pace, the need for more programmers increases everyday. Little options exist to introduce programming to kids successfully, this is why our team decided to attack
1. Foreword. âpawnâ is a simple, typeless, 32-bit âscriptingâ language with a C-like syn- ... language in my publication in Dr. Dobb's Journal and the years since. .... cesses and runs on conforming Pawn programs âeither interpreters or com
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. objective c programming language pdf. objective c programming language pdf. Open. Extract. Open with. Sign I
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. c programming ...