Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the TextMate Language Parser?

Does anyone know where the code TextMate uses for syntax highlighting is burried? If not, do you know how they parse their language syntaxes, or how you would parse their language syntaxes?

That would be awesome to look into.

Thanks! Lance

like image 258
Lance Avatar asked Sep 30 '09 11:09

Lance


1 Answers

I believe TextMate uses Antlr for parsing. Look for it inside the package. Antlr has an Objective-C target, but this doesn't mean that Allen Odgaard chose that particular language, but it is highly likely, given that TextMate is a Cocoa application.

Terrence Parr, the creator of Antlr, has written two books on/using Antlr:

The Definitive Antlr Reference

Language Implementation Patterns

Both are worth reading if you are interested in parsing, etc.... Of course, one should eventually move on to the dragon book,, but these books, along with Antlr, will allow you to get moving quickly.

like image 59
Pinochle Avatar answered Oct 13 '22 17:10

Pinochle