February 2009

The new C++0x standard adds lambda expressions to the language. Visual Studio 2010 CTP is already supporting this new feature that brings functional techniques to C++ too. What is a lambda expression? It’s basically a function. In F# it’s an anonymous function, in C# it’s an anonymous delegate; in C++ it’s in fact an anonymous…

Read More Lambdas in C++

After blogging for two years I have decided to make a change in the look of my blog. So I have changed the appearance theme from ‘indigo’ to ‘coogee’. I think it looks better and hopefully will prove to be a better “reader experience”. I tested the new theme on IE7, Firefox 3, Google Chrome…

Read More A New Look

Evaluate Expressions – Part 1: The Approaches Evaluate Expressions – Part 2: Parse the Expression Evaluate Expressions – Part 3: Building the Abstract Syntax Tree Evaluate Expressions – Part 4: Evaluate the Abstract Syntax Tree So far we have managed to parse the text representing an expression and build an abstract syntax tree. The only…

Read More Evaluate Expressions – Part 4: Evaluate the Abstract Syntax Tree

In my previous post we’ve parsed an exception verifying whether it’s correct or not syntactically. But we still have to evaluate it. To be able to do that we’ll have to build an abstract syntax tree. This can be done by modifying the previous code and inserting semantic action. That means we do something more…

Read More Evaluating Expressions – Part 3: Building the AST

In my previous post I have provided some background theory for evaluating expressions with abstract syntax trees. As I was mentioning, the first step towards this goal is to parse the expression, make sure it is correct syntactically. This is what I’ll show you in this post. Having the grammar defined, we’ll make one function…

Read More Evaluating Expressions – Part 2: Parse the Expression