Welcome to Dream.In.Code
Getting Help is Easy!

Join 105,772 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,477 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Generic C/C++ Parser

 
Reply to this topicStart new topic

Generic C/C++ Parser, Easy Binary or Text File Parsing

Cerolobo
post 19 May, 2008 - 05:21 PM
Post #1


D.I.C Regular

Group Icon
Joined: 5 Apr, 2008
Posts: 440



Thanked 30 times
My Contributions


This is a project I have been working on and off of for about a year now. It's basically a tokenizer on steroids.

Instead of supplying a list of single character delimiters, you can actually specify entire strings as token separators. Along with this, you can attach additional logic to the token, such as
-- Should the token be returned? (Think space, new line, ect... removal)
-- Change Token Sets (Allows you to switch what tokens are used at runtime. This is very useful for things like comment removal in code)
-- Callbacks (When a token is found, a function is called. It's nicer then a huge switch statement)

Other features include
-- Built in File I/O, with a specified buffer size (how many bytes of the file to keep in memory at runtime)
-- Various Binary Functions
-- Multiple Token Sets
-- Modifiable at runtime
-- Portable (If ANSI C is supported, it should work)
-- Documentation!
-- -- Lots of code comments
-- -- 70 KB HTML document (NOT from Doxygen or similar)
-- -- 4 Sample drivers

My main development version of the code is in C; however, there is a C++ class version as well.

No executables are included; however, it is very simple to compile. Just pick a driver, and compile it with the Parser (one .h and .c file).

Any comments, suggestions, or reports on warnings/errors will appreciated.


Attached File(s)
Attached File  Cero_Parser_v_7.1.zip ( 54.02k ) Number of downloads: 35
User is offlineProfile CardPM

Go to the top of the page


Cerolobo
post 24 Jun, 2008 - 07:24 PM
Post #2


D.I.C Regular

Group Icon
Joined: 5 Apr, 2008
Posts: 440



Thanked 30 times
My Contributions


Updated the Parser. There were several bug fixes, and you can now pass a parameter to the callback.

Performance Delta:
GNU: 6% Faster then 7.1
MS: No difference

Memory Delta:
Global Data: Increased by sizeof(int) bytes
Token: Increased by sizeof(void *) bytes

Edit: Cleaned up a few compiler warnings. Cosmetic only.
Edit: Ha! Compiles under DeSmet C again. Also, I did find a slight bug. In any case, this should be the last update for this version.

This post has been edited by Cerolobo: 24 Jun, 2008 - 10:22 PM


Attached File(s)
Attached File  Cero_Parser_v_8.0.zip ( 54.44k ) Number of downloads: 10
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 24 Jun, 2008 - 07:34 PM
Post #3


DIC.Rules == true;

Group Icon
Joined: 26 Jul, 2007
Posts: 7,031



Thanked 47 times

Dream Kudos: 7600

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, GDI

My Contributions


I'm going to move this to the Discuss Projects Forum so it will get the attention it deserves smile.gif

EDIT: Whoops blush.gif Didn't realize it already was, sorry smile.gif
User is online!Profile CardPM

Go to the top of the page

Cerolobo
post 7 Jul, 2008 - 09:03 PM
Post #4


D.I.C Regular

Group Icon
Joined: 5 Apr, 2008
Posts: 440



Thanked 30 times
My Contributions


Well, I finally broke down and picked up a SourceForge account. Further versions of the library can be picked up here

http://sourceforge.net/projects/ceroparser/

I will continue to post updates here. Regardless, I tend to only get a desire to work on it once every few months, so don't expect any updates any time soon.
User is offlineProfile CardPM

Go to the top of the page

Tom9729
post 8 Jul, 2008 - 06:35 PM
Post #5


Debian guru

Group Icon
Joined: 30 Dec, 2007
Posts: 1,387



Thanked 7 times

Dream Kudos: 325
My Contributions


QUOTE(Cerolobo @ 8 Jul, 2008 - 12:03 AM) *

Well, I finally broke down and picked up a SourceForge account. Further versions of the library can be picked up here

http://sourceforge.net/projects/ceroparser/

About time. icon_up.gif tongue.gif
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/21/08 03:29PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month