Click here to Skip to main content
Licence CPOL
First Posted 27 Feb 2008
Views 9,221
Downloads 124
Bookmarked 16 times

Parsing - It Is Easy. Base CSharp Classes and Expressions Calculator

By | 13 Mar 2008 | Article
Provide Base C# parsing classes with demo application and description

Introduction

Sometimes you need to analyze a file and look for a simple parsing solution. For this case, I developed some base classes and wrote a description of how you can make it. As an example, I used expression calculator. It is easy but very powerful sample, I think. For developing your own parser, you only need to write rules for your file and write simple classes based on rules. As input you can use any source but default implementation uses text file. You can get different parts (as variable names, numbers, and e.g.) of your file as output.

The sample application can read expressions from a file or from the text box. Expressions are not only parsed but executed too. So you can use it as the powerful calculator.

In addition, I tried to explain how to create your own parser based on my classes.

You can find more detailed description here.

Feel free to write me a notice if you have a question.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

AlexNek

Software Developer (Senior)

Germany Germany

Member

I started my way with Fortran and going via Pascal, Delphi, C and C++. I'm falling in love with C# now.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 Pinmemberche@free.fr23:05 25 Mar '11  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 13 Mar 2008
Article Copyright 2008 by AlexNek
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid