PowerShell, PowerBoots and an Oslo DSL Grammar

by Doug Finke on July 1, 2009

in DSL,Oslo,PowerBoots,PowerShell

David Langworthy, the Microsoft architect who owns The “Oslo” Modeling Language Specification, has these “Modeling in Text” videos HERE that walk through the specific process of creating a domain-specific language.



Working from his example we’ll compile grammar and transform the DSL into Xaml using PowerShell to read and create PS Custom Objects.

  • I ‘embedded’ the DSL (lines 1-6)
  • The DSL Grammar (lines 9-26)
  • Called the M tool chain
    • line 28 the M Compiler
    • line 29 the MGrammar Executor


  • Read the Xaml file produced
    • Converted it to an XmlDocument, line 31
    • Looped through the entities in the graph
  • And generated PowerShell Custom Objects


From DSL => DynamicParser => Custom Objects => WPF data bound control


Using the M tool chain in this ways has it’s advantages in several scenarios. This script can easily be streamlined by checking file dates and bypass the m and mgx steps.

In future posts we’ll see if we can interact with the MGrammar namespace and work with Oslo in a deeper way.

{ 1 trackback }

Chris Sells wants to learn PowerShell because of PowerBoots
07.10.09 at 10:00 pm

{ 1 comment… read it below or add one }

Rich 04.05.12 at 12:34 pm

Now that Oslo is non-existant, is there an easy substitute to do the above? The goal for me is to stay within powershell.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Previous post:

Next post:

You are forbidden!