

Today I’d like to post a status update on the progress of the SyntaxEditor .NET Languages Add-on for WPF. For more information on the add-on’s development, please see the previous posts in this series:
We’ve continued working on the C# grammar implementation that uses our LL(*) Parser Framework.
C# Grammar
We’ve completed the C# grammar, which can parse C# 4.0 and earlier files. It generates a full abstract syntax tree (AST) with type-specific nodes for each kind of node.
Currently there are 118 distinct classes defined for .NET AST nodes, most of which will be used in the VB grammar as well that we’ll be starting on shortly. The AST nodes are all code generated using new features in our Language Designer application.
C# Intelligent Parse Error Reporting
We’ve spent a lot of extra time on the C# grammar to ensure that it provides intelligent parse errors as you type. Let’s see some examples.

Above we are typing a class declaration. A parse error tells us we’re missing a { character.
This screenshot also shows the ability for a parse error to render a squiggle at the document end, something that hasn’t yet been possible in SyntaxEditor, but has been added for 2011.1.

Here we’ve added a method and have it returning an expression. The expression is an equality expression but we’re missing the right half of the text expression. A parse error tells us that we need to input an expression at that location.

Finally above we have a LINQ query expression that is incomplete. A parse error tells us that we need a select or group clause next.
These sorts of helpful parse errors are pervasive throughout the entire C# grammar and will certainly be helpful to end users.
C# Automatic Outlining
You might have also noticed above that we have automatic outlining now working for type declarations, member declarations, and a couple other areas.
C# Grammar Unit Tests
We’re currently in the midst of compiling a complete set of unit tests that will test the entire C# grammar and warn us if our AST output doesn’t match what we expect.
This will allow us to make changes in the future and ensure that the AST output remains correct.
VB Grammar Next
Work on the Visual Basic 10 grammar will begin shortly. So far, we appear to be on target for a WPF Studio 2011.1 release in late January to early February that will include these features, along with a number of other enhancements and new controls in other WPF products.