views:

479

answers:

3

I've been using Oslo for MSchema. Works great. I can write an M Schema for a database design and it generates T-SQL to build the entire db with PKs, FKs, checks for integrity etc. I've set up a .bat file to compile the .m into .mx then load it into the db, then run SqlMetal into my project and in 30 seconds I'm moving on with my changes. I love it.

OK so now I'm moving on into mGrammar. I'm not quite sure how I'll incorporate it into my app but I'll figure that out. What I need first is to set up Intellipad to give me the Input/Grammar/Output triptych. I'm stumped. I can't figure out any way to set it up with a flow. Yes I can probably take the song.mg project and rename it but that doesn't give me any insight into how the thing works. Any ideas?

+6  A: 

Here are the steps you have to take

  1. Open "Intellipad (Samples Enabled)"
  2. File->Open your DSL file (Example.song)
  3. CTRL+SHIFT+D, type "SetMode('MGMode')"
  4. From the menu: MGrammar Mode->Tree Preview
  5. Select your grammar file (Song.mg)

This will open up the three preview view. The left window is your sample code, the middle one is your grammar and the right is a tree structure of your output.

justin.m.chase
Thanks, that works Justin. Why is there a 'Samples Enabled' version? I've scanned the documentation but I haven't seen any explanation of that. Do I always use that version?
You have to use the samples enabled version unless you add the extensions to your default profile which loads when you start intellipad. There's a great video from PDC08 on the channell9 site which talks about it.
Jonathan Parker
+4  A: 

As @Just-in-case said, but simpler if you just:

(1) CTRL - SHIFT - T

(2) Open the MG file

I.e, From lab doc:

  • Open Intellipad (Samples Enabled) either from the start menu or by entering the following command (from "c:\Program Files\Microsoft Oslo SDK 1.0\Bin"):

"c:\program files\Microsoft Oslo SDK 1.0\bin\Intellipad\ipad.exe" /c:ipad-vs-samples.xaml

Note: "ipad-vs-samples.xaml" is a configuration that enable additional functionality including the dynamic parse editing mode that we are about to use.

  • In Intellipad, use CONTROL-SHIFT-T to open Intellipad in Dynamic parser mode.

  • Select the Movies.mg file in the IntroToM\Example02-MovieDSL\begin folder.

In the May 2009 CTP I had to open the mg file first and then hit CTRL-SHIFT-T to open the input file. Otherwise it did not give me the tree preview mode (which is no longer in the menus)
Mike Two
A: 

You might have experienced, that MSchema and MGrammar are not integrated that well yet. Read more about that here: http://tinyfinger.blogspot.com/2009/01/mgrammar-mschema-example.html

Lars Corneliussen