Midnight
Beach's Syntax Highlighter is a 'tray program' that reads C++
or Delphi source from the clipboard, and writes it back to the clipboard
with HTML and RTF markup. This allows you to change the way source code
looks in Web pages and word processor documents from this
function Sign(A: integer): integer; // -1..1
begin
if A < 0
then Result := -1
else if A = 0
then Result := 0
else Result := 1;
end; // Sign
to this
function Sign(A: integer): integer; // -1..1
begin
if A < 0
then Result := -1
else if A = 0
then Result := 0
else Result := 1;
end; // Sign
- pretty much*
the way it does in a Borland IDE.
Syntax Highlighter is written in Borland's C++Builder 3.0, and
runs on Windows 95 and Windows NT. Version 1.0 is awfully slow - anything
over a few tens of lines takes a noticeable amount of time, and thousands
of lines take minutes - but since I only write an article or two a year,
it works well enough for me. (I don't have a lot of experience with the
STL, and am probably doing some really bone-headed things that are making
it slow. I'd certainly appreciate comments
on the source from anyone who knows more about the STL than I do!)
* While the Borland IDE's let
you set character attributes for many different sorts of code, Syntax
Highlighter only supports six different code types.
For example, assembler is not supported at all, and where the IDE's
distinguish between eg integers and floats, and between
characters and strings, Syntax Highlighter lumps these together as
Numbers and Text respectively. This pretty much corresponds to the way
I use syntax highlighting - if you'd really like to see more code types,
you can try to persuade me to
add them.
|
|
|