Let me be a bit more specific about the information I'm seeking. I'm
guessing that syntax highlighting is usually accomplished in text editors by
comparing the string delimited by the insertion point and  the last
separating character (space, comma, paren, brace, etc.), then bracketing the
string with some kind of non-printing escape code or tag that the editor
reads but the compiler ignores. The editor then renders the text like a
browser renders HTML presentation tags.

My questions are:

1. Am I on the right track or is there a better way?

2. If I am on the right track, is there any kind of standard escape code
that most C compilers understand the way they understand to ignore tabs and
linefeeds? The editor works with the OnBoard C compiler, so the question
should be addressed to Roger Lawrence who developed that, however there are
rumors of other onboard C compiler projects for the Palm, so if there is a
standard I should try to comply with it would be good to know.

3. SrcEdit does not use a field object to display the text, so I can make it
render text any way I want, but most other DOC editors (QED, for example)
use a field. I have a feeling I know the answer to this already, but is
there a way to put a non-displaying escape code into a field? I'd prefer to
make SrcEdit work so that DOCs will be readable in other readers and
editors.  (If the answer is no, then I suppose I'd implement an export
feature.)

4. Does anyone know of any code samples that could give me a leg up on this
feature?

David Beers

-----Original Message-----
From: David Beers [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 02, 2002 9:59 AM
To: Palm Developer Forum
Subject: color syntax highlighting on a Palm



I'm working on SrcEdit, an open source programming text editor for writing
Palm OS code on the Palm. It has rudimentary color suppport and an
autocomplete feature that enables you to enter a few letters of an API
function and then insert the full name by tapping on it in a popup list, but
I'm interested in adding color (or at least grayscale) syntax highlighting.
My question is how best to go about recognizing keywords, keeping in mind
the limited processor resources we're dealing with. The multibit screen
bitmap needs to redraw quickly enough that someone writing with graffiti
doesn't get ahead of the display. Am I dreaming that this is doable on a
33mhz Dragonball?  Any ideas about a general approach?



-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to