Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    195
  • comments
    198
  • views
    104323

other people's code

Sign in to follow this  
SiCrane

102 views

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  


0 Comments


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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!