My first MGrammar

Published on November 7, 2008

To say that I am fascinated by the Oslo project is a bit of an understatement.  I think the mGraph and mSchema capabilities are very interesting and my subconscious mind is working overtime to try and figure out how it fits into my database design, deployment and upgrade scenarios. 

The Oslo repository is a major mystery to me.  I sort of get the concept, but I would be really curious to understand how the designers see it fitting into the current software landscape.  To me, it is partly a place to just store your design models.  It is sort of an Active Directory replacement, or maybe an ADAM replacement.  How should ISV's treat the repository?  Does each ISV create their own private one when the deploy their app.  Should the customer installing the software get the option to say "no don't create your own repository, integrate into my central one"? Do you have one on each client and one on the server or do all clients just point to a server-side one?

Will it be the end of Config files?  I certainly will not miss System.Configuration.

But, I have saved the best for last, mGrammar.  I really don't know if this just another SQL English Query toy that looks really cool but will never make it anywhere, or whether it will be the next big thing.  Either way being able to create DSL's trivially is awesome. 

Check out my new language to assign user to security groups.

remove Joe to DevelopersAdd Bob to Accountantsadd fred to Estimatorsadd bill to Owners

 

And how did I implement this new language?  With this:

 

module MyModule {
    @@{CaseSensitive[false]}
    language MyLang {
    
        syntax Main = statement*;
        
        syntax statement = v:(add|remove) u:user "to" r:role 
            => statement[verb[valuesof(v)],user[u],role[r]] ;
        
        token add = "Add";
        token remove = "Remove";
        token user = letter+;
        token role = letter+;
        
        interleave Whitespace = Space |LF | CR;
        
        token letter = ("A".."Z" | "a".."z");
        token LF = "u000A";
        token CR = "u000D";
        token Space = "u0020";
    }
}

If you are curious as to what the @@#$#@@$ I am talking about, check out the Oslo Developer center for more info and download the SDK.