Grammar
Cling is able to parse everything that clang can. Current clang status can be found here. At the moment, there are use cases only for C++ that's why cling is best in working with C++. Clang has support of C, objC, objC++ and we are looking forward to having more use-cases and extend our tool in that direction.
- Cling has internal commands, which can change its behavior at runtime. Those commands usually start with dot (.):
- .I <path> - Adds an include path;
- .x <filename> - #include-s the filename; and calls function called filename();
- .L <libname> - Loads libname or #include-s the libname if libname is file;
- .@ - Cancels the multiline input;
- .printAST - (DEBUG ONLY) Turns on the printing of the compiler's abstract syntax tree (AST);
- .dynamicExtensions - Turns on cling's dynamic extensions. This in turn enables the dynamic lookup and the late resolving of the identifier. With that option cling tries to heal the compile-time failed lookups at runtime;
Details
Command line
The interactive prompt supports an emacs-like command line editor, just like bash terminal, which makes it easy to integrate and use. Cling uses TextInput and doesn't depend on ncurses.
Autocompletion should be coming soon!