Share via

Basic DSL Authoring Configuration ("Intellipad")

[This content is no longer valid. For the latest information on "M", "Quadrant", SQL Server Modeling Services, and the Repository, see the Model Citizen blog.]

The code name “Intellipad” tool has a basic domain specific language (DSL) authoring configuration that allows you to create test input and see the output for a DSL grammar that you are developing. The input is processed in real time, so you can immediately see the effects when you change either the input or the grammar.

To create the basic DSL authoring configuration

  1. Change your view to DSL Grammar mode. There are two ways you can do this. You can either click the mode label in the upper right corner of the view and select DSL Grammar Mode or you can use the SetMode function of the mini-buffer. Note that if you open a .mg file, the active view is automatically changed to DSL Grammar Mode.

  2. Click the DSL menu entry, and select Split New Input and Output Views.

Description of the Basic DSL Authoring Configuration

When you select Split New Input and Output Views, two things happen. First, “Intellipad” splits your active view vertically into 3 views. The left view displays a new buffer whose mode is set to the name of your original DSL grammar buffer. The middle view displays your DSL grammar. The right view displays the same buffer as the left view, but its mode is set to Output Mode. The left view acts as input data so you can test your grammar. You can edit the left view, and its contents are parsed in real time according to the grammar rules specified by your DSL grammar. The results of the parsing are displayed in the right view, which is read-only. The displayed output is a textual representation of an in-memory .NET Framework object model.

The second thing that happens when you create the basic DSL authoring configuration is that “Intellipad” creates a new view along the bottom of the “Intellipad” that displays the error buffer. This buffer displays any errors that are generated by either the compiler or by “Intellipad” itself. If the error buffer is already being displayed, “Intellipad” does not create a second view.

Using a File for Input

To use a file for your test input

  1. Create the basic DSL authoring configuration as described previously.

  2. Click the Input window to make sure that it is in focus.

  3. Click the File menu entry, select Open... from the drop down menu, and select the file that you want to use for your test input.

  4. Click the buffer source in the upper left corner of the Output window. Select your test input file from the drop down menu.

  5. Click the mode label in the Output window and select Output Mode from the drop down menu.