Name Last modified Size Description
Parent Directory 01-May-2009 11:06 -
BROWSE 14-May-2006 21:11 32k
COPYING 14-May-2006 21:11 1k
INSTALL 14-May-2006 21:11 1k
INTRO 14-May-2006 21:11 5k
Makefile 14-May-2006 21:11 1k
Makefile.config 14-May-2006 21:11 1k
NEWS 14-May-2006 21:11 3k
cruse.tar.bz2 14-May-2006 21:11 390k
etc/ 08-Dec-2004 22:17 -
include/ 04-Dec-2004 21:19 -
python/ 18-Nov-2004 01:22 -
src/ 06-Mar-2006 00:17 -
test/ 06-Mar-2006 00:18 -
Cruse is a very basic Emacs-like text editor. It was written as a C++
demo for a job application. It features extensibility in Python,
through which a little of the editor is defined.
All files are in the public domain. Some of the wrapper files that
are generated by SWIG at build time contain copyrighted portions.
Brief building instructions are available in the file "INSTALL",
there's a list of key bindings in "etc/KEYS", and there are a few
screen shots in "etc/".
Three additions can be directed into the build:
- A small example of the CERN libraries: "C-cr" writes a 1000 pairs
of random numbers into the current buffer, and "C-cg" graphs
distributions of the numbers.
- Evaluation of one-line multiple precision integer expressions,
using GMP. With this addition "C-ci" echoes the result of the
evaluation of the expression on the current line. "test/gmp"
contains example expressions.
- A small example of the Parma Polyhedra Library (PPL): "C-cp"
echoes a description of the polyhedron defined by the ascii dump
in the current buffer. The "test/ppl-*" files contain example
dumps.
A file-level summary follows, including lists of C++ features used.
Makefile
--------
Compile with `make'. Always links to ncurses and Python.
Requires SWIG. See "INSTALL" for details.
Cruse.h
cruse.cc command line interface
-----------------------------------------
The class Cruse extends CursedEditor and CommandLine. Arguments
are processed via CommandLine.
Usage: cruse [OPTION]... FILE_NAME
C++: multiple inheritance, string, sstream
CommandLine.h command line processing
------------------------------------------
Generic class for command line option processing.
C++: template, virtual, member function pointer, vector, string,
map, iterator, this
Editor.h
Editor.cc
PythonedEditor.h
PythonedEditor.cc
CursedEditor.h
CursedEditor.cc the editor
-----------------------------
Editor is an abstract class. An Editor can contain Buffers and
SupplyWindows, and contains a ConsT<Cons> to hold the clip ring.
The clip ring is a history of clips (a.k.a. cuts and kills) and
copies.
PythonedEditor extends Editor, adding evaluation of buffers and
regions of buffers by the Python interpreter.
CursedEditor extends PythonedEditor, using curses to render the
display.
C++: single inheritance, virtual, abstract class (Editor), static
member variable, static member function, string, vector,
ifstream, ofstream, sstream, pair, iterator, this, extern
"C", friend
Window.h
SupplyWindow.h
SupplyWindow.cc basis for screen partitioning
------------------------------------------------
A Window contains a Buffer. SupplyWindow extends Window,
supplying successive visible characters to a caller.
C++: single inheritance, function init list, forward class
declaration, inline, bool, vector, sstream, iterator, this
Buffer.h
Buffer.cc
CERNBuffer.h file buffer
------------------------------
A Buffer contains the characters from a file as a Cons list,
providing an interface for manipulating and saving the file's
sequence of characters.
CERNBuffer extends Buffer, adding a member function to insert
pairs of random floats into the buffer.
C++: namespace, bool, string, ofstream, ifstream, this, default
parameter value
Cons.h
Cons.cc simple Lisp-like linked list contruct
--------------------------------------------------------
Conses are two part constructs that can be chained together to
form lists.
ConsT is a template for defining a cons class with a car (value)
which points to a given type. The type Cons (as used by Buffer)
is ConsT<void>.
BasicCons extends Cons, leaving freeing of any linked constructs
to the caller. It is only used in the tests.
C++: class template, function template, single inheritance,
function init list, namespace, bool, operator overloading (>>),
friend
test-Buffer.cc
test-Cons.cc
printCons.h tests
------------------------
`make test' compiles and runs two test programs that use and print
Buffer and Cons objects.
bindables.h
bindables.cc bindable functions
-------------------------------------
Wrapper functions, for binding to key sequences.
editing.py editing extensions
-------------------------------------
A few Python functions which extend the editor.