Text Transformation with MGrammar and the Oslo SDK
Running the Sample
There are some tricks to running the sample code.
First, to build and run an MGrammar application you must select the "Sample Enabled" Intellipad. Next you must select "Minibuffer" and type SetMode("MGMode") to enable MGrammer. The graphic below demonstrates enabling MGrammar mode.
Click here for a larger image.
Figure 3: Setting MGrammar Mode
Finally, you must select the "Tree Preview" option to be able to enter text and see it transformed to MGraph. The graphic below demonstrates how to do this.
Click here for a larger image.
Figure 4: Tree Preview Selection
Conclusion
MGrammar is a feature in the "M" programming language shipping with the Oslo SDK. MGrammar was built to make transforming Semi-structured text easier. Rules are the Core of MGrammar. Syntax and Token Rules define the text patterns and transformations.
Sources
- Oslo SDK Documentation—in particular, the "MGrammar Language Specification" document.
- "Building Textual DSLs with the Olso Modeling Language": http://channel9.msdn.com/pdc2008/TL31/
About the Author
Jeffrey Juday is a software developer specializing in enterprise integration solutions utilizing BizTalk, SharePoint, WCF, WF, and SQL Server. Jeff has been developing software with Microsoft tools for more than 15 years in a variety of industries including: military, manufacturing, financial services, management consulting, and computer security. Jeff is a Microsoft BizTalk MVP. Jeff spends his spare time with his wife Sherrill and daughter Alexandra. You can reach Jeff at me@jeffjuday.com.
Page 3 of 3
This article was originally published on February 17, 2009