[ i've augmented pierre's package with some contributions from Vanessa Conchodon. she has added some more support to the latex filter, and written a cweb filter. -pgf ] ----------------------------- Introduction ============ I found c-filt.flex in the vile 5.6 package, corrected and improved it. I find it very useful and write the other ones for my favourite languages on the same model. I've tried to keep a style of coloring (for example, all the comments in all the filters are on the same colour). Files ===== You'll find 5 filters in 5 different files for 5 different languages : File : Language c-filt.flex : C/C++ html-filt.flex : HTML latex-filt.flex : LaTeX make-filt.flex : Makefile perl-filt.flex : PERL a coloration.rc sample who recognize the extension of the file when you load it in vile and colors it automatically. and a .Xdefaults sample file. To use them : Ex: You want to test the C/C++ filter 1) Compile c-filt.flex with flex (GNU lex). You'll get a lex.yy.c file 2) Compile this file with a C compiler and call it vile-c-filt (for example) 3) Change your coloration.rc file (i put a coloration.rc example file with) Filters features ================ C/C++ : This filter colors : + the preproc commands (#...) + C/C++ keywords (auto, break, case, ...) (I think all keywords) + C/C++ types (char, int, float, ...) + strings ("this is a string") + numbers (integer and real) + 3 types of comments : + /* comments even on many lines */ + // comment til the end of the line + #if 0 All the lines between these 2. #endif HTML : This filters colors : + comments (<!-- comment -->) + a lot of keywords (I don't have an exhaustive list...) + strings ("this is a string") LaTeX : This filter colors : + comments (% til end of line) + functions (all word beginning with a \) + numbers (integer and real) Makefile : This filter colors : + comments (# til end of line) + targets (file: ) + variables (var= and $(var)) PERL : This filter colors : + command line (#!/bin/perl) + keywords (the list I have...) + comments (# til end of line) + numbers (interger and real) + variables ($var) + string ("string") Please ====== I'm not God. My filters have certainly bugs. Send me a mail if you find a problem or a solution. I will try to answer as fast as possible. Feel free to distribute these files, to modify them and to send me new (better) releases. =============================================================================== 22. August 1996 Pierre DITTGEN, Marne-la-Vallee University, FRANCE. dittgen@univ-mlv.fr =============================================================================== Thanks to: * Richard Mitchell (mitchell@osb1.wff.nasa.gov) The problem I had with the automatic coloration of the file was this : When you execute xvile with a file which can be colorized : $ xvile foo.c <-- (example) The main window is split in two parts and the second part contains a report of the execution of the source files (including coloration.rc) Richard Mitchell finds a way to avoid this, just adding the option :set nopm (set no popup-msgs) in the .vilerc file. So, please add the line ":set nopm" in your .vilerc file to suppress the report window when you execute xvile. * Frank Sicard (sicard@univ-mlv.fr) The strings coloration (in C programs) was not good. The coloration of "Hello, World !" worked BUT the coloration of "Hello \"World\" !" was not OK because of the definition of the STRING token in flex files. There is now a new definition of the STRING token (with help from Frank Sicard) in two lines : NOSTRBRK "\\\"" STRING \"([^"]|{NOSTRBRK})*\" The first line defines what is NOT a string break The second one is the definition of the STRING All flex files with the STRING definition have been modified. 16. September 1996 Pierre DITTGEN, Marne-la-Vallee University, FRANCE. dittgen@univ-mlv.fr
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.