Pages

Google Search

Thursday, April 2, 2009

Code Snippets (2)

After I couldn't find a decent way to implement nice, colorful code snippets inside blogger (which holds me back from posing code related articles) as I mentioned in my last post, and after checking "CopySourceAsHtml" as suggested by Asher in his comment to my last post (and didn't like it - it creates HTML I really don't want to use), I decided to go on with writing my own converter.I used the GOLD parsing system, along with the Calitha gold parser engine to parse source code of a given grammar (grammars for GOLD can be found here), added some metadata to that grammar (currently I've only done a proof-of-concept, so everything is hard-coded) that defines how to indent and colorize (HTMLize) it, and wrote this application:

(click to enlarge)

Next will probably be adding another language (C# - currently only tried it with XML), extracting metadata to external files (should see if I can merge it with the GOLD parser grammar files, and read it from there somehow), and making things look nicer, for starters.

The code is currently not available for download, but I'll probably start a project on sourceforge for that soon. I'll post an update when I will.

About Me

I am a professional software developer and architect with latest experience in C#/.Net and web technologies.
Most professional work includes development of infrastructures and C4I systems, but I also had some experience related to gaming, and currently doing full stack development which includes ASP.NET servers, HTML5 UI and some backbone supporting applications.
I love to code as a hobby, when I find the time. In my personal projects I use mostly PHP for web development, and C# for small tester apps. I tried doing some personal mobile development, but unfortunately I don't have anything to show.