Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 655
Weej Avatar asked Mar 02 '23 03:03

Weej


2 Answers

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.

like image 56
justin.m.chase Avatar answered May 16 '23 08:05

justin.m.chase


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.
like image 26
user47892 Avatar answered May 16 '23 08:05

user47892