by Bill Henning (Actipro)
August 25, 2009 at 10:11
SyntaxEditor for WPF, our syntax-highlighting code editor control, has just made some big improvements to the Oslo Dataflow (MGrammar) Add-on. The enhancements include the ability to asynchronously parse text and return AST and syntax error results. These updates appear in the latest WPF Studio build.
What is the Oslo Dataflow (MGrammar) Add-on?
The add-on is a free component that any SyntaxEditor for WPF customer can use. It allows you to easily integrate parsers created via MGrammar with SyntaxEditor. Previously, the add-on supported tokenization (lexing) and was able to drive syntax highlighting within the editor, all with just a few lines of code, as described in this previous post.
Parsing, AST construction, and error reporting
The add-on now includes a new DataflowParser class that implements IParser. When registered with your language, documents using the language that are changed (generally by user typing) automatically log a request to have parsing done. The parsing requests are queued and call back to the IParser on a worker thread. At this point the IParser performs a parsing operation. In the case of DataflowParser, the parsing operation is a call to Oslo’s DynamicParser. Our DataflowParser then returns an object of type IDataflowParseData, which has a property containing the AST graph node result along with a list of IParseError objects, if any. The IParseError objects indicate syntax errors that occurred during the parse.
|

|
The screenshot above shows the updated sample included with WPF Studio. It now listens to the document’s ParseDataChanged event, which is an event that fires whenever the document’s ParseData property is updated. From this event, we write out the AST in the pane on the right and list the errors, if any, on the bottom. More...
by Bill Henning (Actipro)
August 24, 2009 at 03:59
We’ve just released WPF Studio 2009.1 build 504. This is a huge update and includes some major new functionality that we’ll talk about in more detail over the coming days. In this post though, let’s do a brief overview of some of the larger updates.
See our related forum announcement for exact details on what updates were made in each product.
| DataGrid for WPF After a lot of user demand, we’ve added DataGrid functionality to WPF Studio. I’ve talked a lot about Actipro’s desire to embrace open source solutions as we move forward. Here is another instance. A lot of developers may not realize it but Microsoft has created an official WPF DataGrid that is open source and part of their CodePlex WPF Toolkit project. The DataGrid is slated to be part of .NET 4.0’s native controls as well. The DataGrid has many of the core features you’ll find in any grid offering. What we’ve done is made a number of extra enhancements and behaviors, and added them to an open source project of our own. This project also includes new Office themes that match the look of our other controls, along with updated system themes that look better than the default. Best of all, we’ve made the control take advantage of our ThemeManager so that you can switch themes on the fly. Our open source Contrib add-on is available on CodePlex at: We have taken things another step forward by offering an interop assembly that makes it simple to integrate our the masked and part-based editors in our Editors for WPF product with the DataGrid. Be sure to download the build 504 evaluation to see the new DataGrid functionality in action. |
| SyntaxEditor for WPF MGrammar add-on gets asynchronous parsing, error reporting features The MGrammar add-on has been updated to use our parsing framework. Now when the Oslo Dataflow add-on is being used, as the end user types in the SyntaxEditor, a parse request is queued up and dispatched to a worker thread. The worker thread parses the entire document in the SyntaxEditor and builds an AST and list of syntax errors. These are returned back to the SyntaxEditor asynchronously, with no UI thread blocking. The MGrammar Integration sample has been updated to show an AST and error list that are built asynchronously as you type. Free ANTLR add-on added A popular request for years has been the ability to integrate the ANTLR parser with SyntaxEditor. With today’s release, this is now easy and can be done with very little code. The ANTLR add-on allows you to enable automated asynchronous parsing calls to the ANTLR parser, similar to the functionality described above for MGrammar. This previous blog post describes the functionality in detail. A new sample project has been added to demo this add-on. Completion list enhancements (auto-shrink, performance improvement) We’ve implemented another popular request item for completion lists: the ability to auto-shrink the visible list of completion items as the end user types. This functionality is found in Visual Studio when editing VB files. See this previous blog post for details and a series of screenshots showing the functionality. The performance of the completion list item matcher algorithms has been improved in a number of areas too. Hit testing This build adds the ability to perform detailed hit testing within SyntaxEditor. You simply pass it a Point and it returns an object that tells you everything you need to know about what is at that location. We’ve added a new QuickStart to show off the hit testing feature. |
by Bill Henning (Actipro)
August 11, 2009 at 10:08
We’re very excited to officially announce that the next build of WPF Studio will contain a new assembly that makes it easy to automatically call an ANTLR-generated parser via worker threads whenever SyntaxEditor document text changes. This new assembly will be included free for use by any of our SyntaxEditor for WPF customers.
What is ANTLR?
ANTLR, ANother Tool for Language Recognition, was created by Terence Parr and is one of the most widely-used parsing frameworks available. ANTLR is a framework for constructing recognizers, interpreters, compilers, and translators from grammatical descriptions containing actions in a variety of target languages. ANTLR provides excellent support for tree construction, tree walking, translation, error recovery, and error reporting.
New Sample to Demonstrate ANTLR Add-on
We’ve built a new sample project that demos a calculator parser generated by ANTLR. This new sample project will be in the next WPF Studio build.
The sample has a SyntaxEditor instance at the lower left. You can enter a simple integer mathematic equation into the editor. When text changes occur, SyntaxEditor uses its advanced parsing framework to call an ANTLR parser in a worker thread. The parser returns its AST result back to the document asynchronously when it completes. More...
by Bill Henning (Actipro)
June 2, 2009 at 08:00
Now that the public beta of SyntaxEditor for WPF has been released, I’d like to show off a really neat feature that you probably haven’t heard about yet. Microsoft has been working on a new modeling technology that has been codenamed “Oslo”. You can read all about it here:
http://msdn.microsoft.com/en-us/oslo/default.aspx
One piece of Oslo is the ability to create GLR-based text parsers that basically parse text and output an AST node graph. This part of Oslo is called MGrammar. We first looked into this technology back at PDC 2008 and became involved with the Oslo team shortly thereafter. Special thanks go out to Chris Sells and his team for all their help. Our goal was to make an add-on for our SyntaxEditor control that provided syntax highlighting within the control based on an MGrammar DSL parser.
|  The MGrammar Integration sample included with WPF Studio, which shows a SyntaxEditor instance that has loaded an MGrammar DSL parser and is using it for syntax highlighting |
We’ve implemented this new Oslo Dataflow Add-on and have included it in the WPF Studio 2009.1 release that came out last week. Download the WPF Studio Evaluation to check it out… it includes a complete sample project showing how simple it is to get working. More...