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

Join 132,487 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,131 people online right now. 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 - 04:21 PM
Post #1


D.I.C Regular

Group Icon
Joined: 5 Apr, 2008
Posts: 440



Thanked 31 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: 42
User is offlineProfile CardPM

Go to the top of the page

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


D.I.C Regular

Group Icon
Joined: 5 Apr, 2008
Posts: 440



Thanked 31 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 - 09:22 PM


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

Go to the top of the page

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


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,927



Thanked 118 times

Dream Kudos: 8475

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

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 - 08:03 PM
Post #4


D.I.C Regular

Group Icon
Joined: 5 Apr, 2008
Posts: 440



Thanked 31 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 - 05:35 PM
Post #5


Debian guru

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



Thanked 10 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: 11/22/08 03:58PM

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