Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

other people's code

Sign in to follow this  


So, I finally got around to starting to implement syntax highlighting for source blocks, so like a good programmer my first instinct was to look for components to reuse. Since I'm using C#, I first looked for C# syntax highlighting programs, but I couldn't find one with the level of customization I wanted, so I turned to C/C++ programs that I might be able to repackage as a .NET assembly.

The first C++ package I looked at was ancient, but updated incrementally over the years. Consequently it was a mess. Some source files were written in C, some were in C++. There were multiple flex generated parsers mixed in the same program, and a lot of communication was performed using global variables. Needless to say I passed on that one.

The second one I looked at seemed clean at first, but contained a lot of simple C++ mistakes like passing std::string objects by value instead of const references, out of bounds array access and memory leakss. However, it seems to do what I want, and seems well enough contained that I should be able to extract the actual parsing parts without too much trouble. Now the question is if I try to go through and clean things up on the insides.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!