Re: Syntax Coloring?

2009-09-19 Thread Uli Kusterer
I would hope that there's come Cocoa class for parsing source text into tokens etc, but don't know of anything. For what it's worth, this may help: http://zathras.de/sourcecode.htm#UKSyntaxColoredTextDocument It shows you how to re-examine only the parts that actually changed, and not the

Re: Syntax Coloring?

2009-08-26 Thread Uli Kusterer
On Aug 25, 2009, at 5:13 AM, Rob Keniger wrote: On 25/08/2009, at 11:36 AM, Keitaroh Kobayashi wrote: Anyways, I was thinking I could keep the basic flex part, and apply it only to the changed portions of the text. The problem with that is that I would have to check for quotes and record

Re: Syntax Coloring?

2009-08-24 Thread Keitaroh Kobayashi
On Sun, Aug 23, 2009 at 9:32 PM, BareFeet list.develo...@tandb.com.auwrote: Hi Keita, Hello, I'm writing a code editor and so far, i've been using Flex for regex-matching the whole document every time the text is changed and coloring appropriately... How are you doing this? How did you

Re: Syntax Coloring?

2009-08-24 Thread Behrang Saeedzadeh
Hi there, Somebody has written a complete thesis about this and other common tasks required for developing IDEs: twagner-lexing.pdfhttp://www.cs.berkeley.edu/Research/Projects/harmonia/papers/twagner-lexing.pdf . http://www.cs.berkeley.edu/Research/Projects/harmonia/papers/twagner-lexing.pdfIn

Re: Syntax Coloring?

2009-08-24 Thread Rob Keniger
On 25/08/2009, at 11:36 AM, Keitaroh Kobayashi wrote: Anyways, I was thinking I could keep the basic flex part, and apply it only to the changed portions of the text. The problem with that is that I would have to check for quotes and record what's inside the quote from where the person

Re: Syntax Coloring?

2009-08-23 Thread BareFeet
Hi Keita, Hello, I'm writing a code editor and so far, i've been using Flex for regex-matching the whole document every time the text is changed and coloring appropriately... How are you doing this? How did you incorporate Flex or regex-matching? I approached it using regex to parse the

Re: Syntax Coloring?

2009-08-23 Thread Rob Keniger
to Cocoa. I implemented basic syntax coloring for HTML documents without too much difficulty. You need to set an object as the delegate of your NSTextView's NSTextStorage object. In this delegate, implement - textStorageDidProcessEditing: which is called when the text changes, and do your

Syntax Coloring?

2009-08-22 Thread Keitaroh Kobayashi
Hello, I'm writing a code editor and so far, i've been using Flex for regex-matching the whole document every time the text is changed and coloring appropriately... I got this idea from some CocoaBuilders or CocoaDev forum/mailing list awhile ago, but it's terribly inefficient and slow, especially

Re: Syntax Coloring?

2009-08-22 Thread Jean-Daniel Dupas
Le 22 août 2009 à 14:33, Keitaroh Kobayashi a écrit : Hello, I'm writing a code editor and so far, i've been using Flex for regex-matching the whole document every time the text is changed and coloring appropriately... I got this idea from some CocoaBuilders or CocoaDev forum/mailing list