Register  Login
Blog
 
Expression evaluator with Interpreter PatternMinimize
Location: BlogsOO Cobol Blog   
Posted by: host5/22/2010

This new sample shows how to create an arithmetic expression evaluator, so the application can evaluate a formula such as:

((a + b) ^(c / d)) * e

or

a + b + c * (d - e)

There some limitations due the way the parser was built:

. Only one letter variables are supported
. There is no numeric literal support. All values must be hold in variables
. Variables are case sensitive (a <> A)

The OO Cobol code is an improved version of Partha Kuchana Java Calculator sample : http://www.java2s.com/Code/Java/Design-Pattern/InterpreterPatternCalculator.htm

Click here to read the article! 

Permalink | Trackback

Your name:
Title:
Comment:
Add Comment  Cancel 
  



Software
  Top Blogs

Blog_ArchiveMinimize
    

Powered by WebRing.
Terms Of Use | Privacy Statement | Copyright 2009-2010 by RedRailsDynnamite DotNetNuke Skins & Modules