Is it possible to create custom Expression classes? If so, does anyone have any examples? Inheriting from the framework abstract Expression class poses a problem in that its constructor takes an ExpressionType parameter, which is a framework enum type - I obviously cannot customise this!
With .net 3.5 you can't do this because the Expression constructor takes in an ExpressionType enum value, and you can't add new node types to the enum.
You can't overload an existing node type either, because you can't inherit from any of the "leaf classes" (like BinaryExpression) because they are all sealed.
According to the MSDN docs it looks like you can do this in CLR v4, as long as you override the "Reduce" method and use a node type ExpressionType.Extension.