Oslo's Intellipad: How to set up the 3 column MGrammarMode?

704 views Asked by At

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?

3

There are 3 answers

2
justin.m.chase On BEST ANSWER

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.

0
Lars Corneliussen On

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

1
user47892 On

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.

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