How to write syntax highlighting?
- by ML
I am embarking on some learning and I want to write my own syntax highlighting for files in C++.
Can anyone give me ideas on how to go about doing this?
To me it seems that when a file is opened:
1. it would need to be parsed and decided what type of source file it is. Trusting the extension might not be full-proof
a way to know what keywords/commands apply to what language
a way to decide what color each keyword/command gets
I want to do this on OS X, C++ or Objective-C
Can anyone provide pointers on how I might get started with this?