<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Development in a Blink &#187; Intellipad</title>
	<atom:link href="http://dougfinke.com/blog/index.php/category/intellipad/feed/" rel="self" type="application/rss+xml" />
	<link>http://dougfinke.com/blog</link>
	<description>Researching the optimal; implementing the practical</description>
	<lastBuildDate>Tue, 09 Mar 2010 02:46:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>10 PowerShell Posts I Did in 2009</title>
		<link>http://dougfinke.com/blog/index.php/2010/01/01/10-powershell-posts-i-did-in-2009/</link>
		<comments>http://dougfinke.com/blog/index.php/2010/01/01/10-powershell-posts-i-did-in-2009/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 20:05:15 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[ISE]]></category>
		<category><![CDATA[Integrated Scripting Environment]]></category>
		<category><![CDATA[Intellipad]]></category>
		<category><![CDATA[MGrammar]]></category>
		<category><![CDATA[Oslo]]></category>
		<category><![CDATA[Pivot Tables]]></category>
		<category><![CDATA[PowerBoots]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[SQL Server Modeling]]></category>
		<category><![CDATA[Try Python]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[trigrams]]></category>
		<category><![CDATA[yUML]]></category>

		<guid isPermaLink="false">http://dougfinke.com/blog/index.php/2010/01/01/10-powershell-posts-i-did-in-2009/</guid>
		<description><![CDATA[I had fun doing these PowerShell posts.
&#160;




Try PowerShell – An Interactive Tutorial


Michael Foord inspired this with his Try Python Silverlight application




How to Host PowerShell in a WPF Application


A How To video




PowerShell Out-ExcelPivotTable – Quickly Create Pivot Tables in Microsoft Excel


Automating Excel Pivot tables with PowerShell




PowerShell, An Exercise in Species Barcoding


Inspired by Peter Norvig’s (Director of [...]]]></description>
			<content:encoded><![CDATA[<p>I had fun doing these PowerShell posts.</p>
<p><a href="http://dougfinke.com/blog/index.php/2009/01/10/11th-grade-activities-for-career-success-powershell/"><img style="display: block; float: none; margin-left: auto; margin-right: auto" title="image" alt="image" src="http://dougfinke.com/uploadPictures/MyTop5PowerShellPosts_85B8/image.png" width="454" height="284" /></a>&#160;</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="276">
<p><a href="http://dougfinke.com/blog/index.php/2009/09/28/try-powershell-an-interactive-tutorial/">Try PowerShell – An Interactive Tutorial</a></p>
</td>
<td valign="top" width="278">
<p><a href="http://www.voidspace.org.uk/python/weblog/index.shtml">Michael Foord</a> inspired this with his <a href="http://www.trypython.org/">Try Python</a> Silverlight application</p>
</td>
</tr>
<tr>
<td valign="top" width="276">
<p><a href="http://dougfinke.com/blog/index.php/2009/09/02/how-to-host-powershell-in-a-wpf-application/">How to Host PowerShell in a WPF Application</a></p>
</td>
<td valign="top" width="278">
<p>A How To video</p>
</td>
</tr>
<tr>
<td valign="top" width="276">
<p><a href="http://dougfinke.com/blog/index.php/2009/06/24/powershell-out-excelpivottable-quickly-create-pivot-tables-in-microsoft-excel/">PowerShell Out-ExcelPivotTable – Quickly Create Pivot Tables in Microsoft Excel</a></p>
</td>
<td valign="top" width="278">
<p>Automating Excel Pivot tables with PowerShell</p>
</td>
</tr>
<tr>
<td valign="top" width="276">
<p><a href="http://dougfinke.com/blog/index.php/2009/02/17/powershell-an-exercise-in-species-barcoding/">PowerShell, An Exercise in Species Barcoding</a></p>
</td>
<td valign="top" width="278">
<p>Inspired by Peter Norvig’s (Director of research at Google) python version</p>
</td>
</tr>
<tr>
<td valign="top" width="276">
<p><a href="http://dougfinke.com/blog/index.php/2009/02/07/powershell-find-the-k-most-common-words-in-a-file/">PowerShell – Find the K most common words in a file</a></p>
</td>
<td valign="top" width="278">
<p>Based on Jon Bentley’s approach in “Little Languages”</p>
</td>
</tr>
<tr>
<td valign="top" width="276">
<p><a href="http://dougfinke.com/blog/index.php/2009/02/06/powershell-ise-cream-alias-expansion/">PowerShell ISE-Cream – Alias Expansion</a></p>
</td>
<td valign="top" width="278">
<p>Uses PowerShell’s tokenizer to expand aliases like %, ? etc. into ForEach and Where</p>
</td>
</tr>
<tr>
<td valign="top" width="276">
<p><a href="http://dougfinke.com/blog/index.php/2009/08/29/update-dynamic-guis-and-the-powershell-pipeline/">Update: Dynamic GUIs and the PowerShell Pipeline</a></p>
</td>
<td valign="top" width="278">
<p>How to inject GUIs into a PowerShell Pipeline</p>
</td>
</tr>
<tr>
<td valign="top" width="276">
<p><a href="http://dougfinke.com/blog/index.php/2009/08/20/powershell-yuml-workbench/">PowerShell yUML Workbench</a></p>
</td>
<td valign="top" width="278">
<p>yUML is a web service.&#160; A How To using PowerShell to generate UML diagrams</p>
</td>
</tr>
<tr>
<td valign="top" width="276">
<p><a href="http://dougfinke.com/blog/index.php/2009/07/01/powershell-powerboots-and-an-oslo-dsl-grammar/">PowerShell, PowerBoots and an Oslo DSL Grammar</a></p>
</td>
<td valign="top" width="278">
<p>Blending MGrammar and PowerShell</p>
</td>
</tr>
<tr>
<td valign="top" width="276">
<p><a href="http://dougfinke.com/blog/index.php/2009/05/20/creating-and-displaying-trigrams-with-powershell/">Creating and Displaying Trigrams with PowerShell</a></p>
</td>
<td valign="top" width="278">
<p>Based on Wolfram|Alphas Trigram visuals. Combines PowerShell and yUML</p>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://dougfinke.com/blog/index.php/2010/01/01/10-powershell-posts-i-did-in-2009/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PowerShell Mode for Oslo&#8217;s Intellipad</title>
		<link>http://dougfinke.com/blog/index.php/2009/03/25/powershell-mode-for-oslos-intellipad/</link>
		<comments>http://dougfinke.com/blog/index.php/2009/03/25/powershell-mode-for-oslos-intellipad/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 02:36:54 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Intellipad]]></category>
		<category><![CDATA[Oslo]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://dougfinke.com/blog/index.php/2009/03/25/powershell-mode-for-oslos-intellipad/</guid>
		<description><![CDATA[I downloaded &#34;MUrl&#34;: An DSL for RESTful Clients. In it is the MUrlMode C# project which creates the MUrl Mode in Intellipad. I pared it down and plugged in the PowerShell script engine.
 

]]></description>
			<content:encoded><![CDATA[<p>I downloaded <a href="http://download.microsoft.com/download/4/0/B/40B632EC-F201-43EE-8E29-C398A9DA8468/MUrlSample.msi">&quot;MUrl&quot;: An DSL for RESTful Clients</a>. In it is the MUrlMode C# project which creates the MUrl Mode in Intellipad. I pared it down and plugged in the PowerShell script engine.</p>
<p><a href="http://dougfinke.com/uploadPictures/PowerShellModeforOlsosIntellipad_13A23/image.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://dougfinke.com/uploadPictures/PowerShellModeforOlsosIntellipad_13A23/image_thumb.png" width="509" height="197" /></a> </p>
<p><a href="http://dougfinke.com/uploadPictures/PowerShellModeforOlsosIntellipad_13A23/image_3.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://dougfinke.com/uploadPictures/PowerShellModeforOlsosIntellipad_13A23/image_thumb_3.png" width="552" height="333" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://dougfinke.com/blog/index.php/2009/03/25/powershell-mode-for-oslos-intellipad/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Discover Intellipad commands using PowerShell</title>
		<link>http://dougfinke.com/blog/index.php/2008/11/04/discover-intellipad-commands-using-powershell/</link>
		<comments>http://dougfinke.com/blog/index.php/2008/11/04/discover-intellipad-commands-using-powershell/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 00:30:50 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Intellipad]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://dougfinke.com/blog/?p=500</guid>
		<description><![CDATA[Get-IntellipadCommands &#124; Out-GridView
This PowerShell snippet searches all the IronPython files deliver with Intellipad, looks for the key word MetaData.CommandExecuted, then extracts the Command Name, Short Cut Key, File Name and&#160; the Line Number the command was found on.
Out-GridView, delivered with PowerShell V2, displays it.
Now you can sort and filter commands and find their short cut [...]]]></description>
			<content:encoded><![CDATA[<h3>Get-IntellipadCommands | Out-GridView</h3>
<p>This PowerShell snippet searches all the IronPython files deliver with Intellipad, looks for the key word <em><strong>MetaData.CommandExecuted</strong></em>,<em><strong> </strong></em>then extracts the Command Name, Short Cut Key, File Name and&#160; the Line Number the command was found on.</p>
<p>Out-GridView, delivered with PowerShell V2, displays it.</p>
<p>Now you can sort and filter commands and find their short cut key. Then, when you want to extend Intellipad and need an IronPython snippet to follow, you have the File Name and Line Number the command is on.</p>
<p><a href="http://dougfinke.com/uploadPictures/DiscoverIntellipadcommandsusingPowerShel_10D85/image.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="249" alt="image" src="http://dougfinke.com/uploadPictures/DiscoverIntellipadcommandsusingPowerShel_10D85/image_thumb.png" width="494" border="0" /></a></p>
<h3>Filtering</h3>
<p><a href="http://dougfinke.com/uploadPictures/DiscoverIntellipadcommandsusingPowerShel_10D85/image_3.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="250" alt="image" src="http://dougfinke.com/uploadPictures/DiscoverIntellipadcommandsusingPowerShel_10D85/image_thumb_3.png" width="496" border="0" /></a> </p>
<h3>PowerShell Code</h3>
</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">dir <span style="color: #006080">'C:\Program Files\Microsoft Oslo SDK 1.0'</span> -r *py |</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"> Select-String Metadata.CommandExecuted |</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"> ForEach {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">  $line = $_.Line</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">  $lparen = $line.IndexOf(<span style="color: #006080">'('</span>)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">  $line=($line.Substring($lparen+1,$line.Length-$lparen-2) -Replace <span style="color: #006080">&quot;'&quot;</span>,<span style="color: #006080">&quot;&quot;</span>).Trim()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">  $<span style="color: #0000ff">null</span>, $cmd, $key = $line.Split(<span style="color: #006080">','</span>)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">  $pos = $cmd.IndexOf(<span style="color: #006080">'}'</span>)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">  $cmd = $cmd.Substring($pos+1)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">  New-Object PSObject |</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   Add-Member -Passthru NoteProperty Command $cmd |</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   Add-Member -Passthru NoteProperty ShortCutKey $key |</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   Add-Member -Passthru NoteProperty LineNumber $_.LineNumber |</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">   Add-Member -Passthru NoteProperty FileName $_.Path |</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"> }</pre>
</p></div>
</div>
<h3>Download Get-IntellipadCommands Code</h3>
<p><iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 26px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-5dec3b62d9308943.skydrive.live.com/embedrow.aspx/Intellipad/Get-IntellipadCommands.zip" frameborder="0" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://dougfinke.com/blog/index.php/2008/11/04/discover-intellipad-commands-using-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Parsers with MGrammar for .Net applications</title>
		<link>http://dougfinke.com/blog/index.php/2008/11/02/building-parsers-with-mgrammar-for-net-applications/</link>
		<comments>http://dougfinke.com/blog/index.php/2008/11/02/building-parsers-with-mgrammar-for-net-applications/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 20:01:59 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Intellipad]]></category>
		<category><![CDATA[MGrammar]]></category>
		<category><![CDATA[Oslo]]></category>
		<category><![CDATA[Parser]]></category>

		<guid isPermaLink="false">http://dougfinke.com/blog/?p=499</guid>
		<description><![CDATA[MGrammar, part of the M Language, is Microsoft’s new addition for writing textual, domain-specific languages. Combined with Microsoft’s Intellipad, it lowers the barrier for developing DSLs for the .Net platform.
&#34;M&#34; is a core feature of &#34;Oslo&#34; and is a language for textually describing and authoring domains. &#34;M&#34; comprises the following: MGraph, MSchema, and MGrammar. MGraph [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/library/dd129870.aspx">MGrammar</a>, part of the M Language, is Microsoft’s new addition for writing textual, domain-specific languages. Combined with Microsoft’s Intellipad, it lowers the barrier for developing DSLs for the .Net platform.</p>
<blockquote><p>&quot;M&quot; is a core feature of &quot;Oslo&quot; and is a language for textually describing and authoring domains. &quot;M&quot; comprises the following: MGraph, MSchema, and MGrammar. MGraph is for serializing data values to a graph structure similar to syntaxes like JSON. MSchema builds on MGraph by providing a structural type system, extent declarations for storing values, and computed values, which are queries over values and extents. MGrammar is used to describe domain-specific languages in terms of rules that are used to transform input text to MGraph.</p>
</blockquote>
<p>The following is right out of <a href="http://xp123.com/oozinoz/">Steve Metsker’s</a> book <strong><em><a href="http://www.amazon.com/Building-Parsers-Java-Steven-Metsker/dp/0201719622">Building Parsers with Java</a></em></strong>. It is amazing how easy it is to use his grammar shorthand to ramp up with MGrammar.</p>
<h3>Example: Designing a Grammar for a Track Robot</h3>
<p>The idea is to create a command language for a simple factory. The robot can pick up, place and scan material on different conveyor belts. Here are some example commands for the robot:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> pick carrier from LineIn</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> place carrier at DBOut</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> scan DBOut</pre>
</p></div>
</div>
<h3>Grammar Rules</h3>
<p>Using the shorthand rules we&#160; have this</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">command = pickcommand | placeCommand | scanCommand;
pickCommand = <span style="color: #006080">&quot;pick&quot;</span> <span style="color: #006080">&quot;carrier&quot;</span> <span style="color: #006080">&quot;from&quot;</span> location;
location = Word;</pre>
</div>
<h3>Intellipad and MGrammar</h3>
<p>Create a file called <em>Robot.mg, </em>start Intellipad. Make sure to start Intellipad (Samples Enabled). </p>
<p><a href="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin-left: 0px; margin-right: 0px; border-right-width: 0px" height="35" alt="image" src="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_thumb.png" width="191" border="0" /></a> </p>
<p>Once launched, press Ctrl-Shift-T. In the open file dialog specify the location of <em>Robot.mg</em>. There should be 4 panes.</p>
<p><a href="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_3.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="270" alt="image" src="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_thumb_3.png" width="491" border="0" /></a> </p>
<p>The middle pane, in MGrammarMode, is where we will define the Robot grammar using MGrammar. The left pane, DynamicParserMode, is where we can type the example commands. The right pane, MGrammarPreviewMode, will contain the parse tree when the example commands are successfully processed by the grammar. The bottom pane, HyperlinkMode, shows errors from either the left pane or middle pane.</p>
<p>As you specify the grammar in the middle, errors will show up in the bottom. For things like invalid MGrammar syntax or errors in your example commands being fed into your grammar. </p>
<h3>Productivity</h3>
<p>Intellipad is productive. Typing in either the left or middle pane kicks off the cycle. Meaning, it compiles the grammar and takes whatever is in the DynamicParserMode and runs it against your parser. Errors will show up as squiggles and hyperlinked elements in the error pane.</p>
<p>Let’s start by defining the pickCommand. In the DynamicParserMode pane I enter the example command and then flesh out the grammar in the middle.</p>
<p><a href="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_4.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="236" alt="image" src="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_thumb_4.png" width="505" border="0" /></a> </p>
<p>Here, I use MGrammar’s <em><strong>module, language </strong></em>and<strong><em> syntax </em></strong>keywords. I do not compile the grammar, Intellipad does this as I type, and reports errors as I go. Intellipad also runs the text in the DynamicParserMode pane against the grammar. This streamlines the process. I don’t have to set up a test harness, or compile the grammar or create the code for feeding the commands to my DSL.</p>
<h3>Defining the pickCommand</h3>
<p>Below I define pickCommand taking the literal <strong><em>“pick”</em></strong>.&#160; The MGrammar statement<strong> <em>syntax</em></strong><em> Main = command;</em> kicks off the matching against the process.</p>
<p>Intellipad reports an error showing a red squiggle in my robot command. You can click the error line in the HyperlinkMode window and it will jump to that location.</p>
<p><a href="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_5.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="229" alt="image" src="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_thumb_5.png" width="490" border="0" /></a> </p>
<p>Add a few more literals to pickCommand and the <strong><em>interleave</em></strong> keyword to handle whitespace. </p>
<p>Notice the the error moves to <em>LineIn</em> in the example command. <em>LineIn</em> is a ‘variable’ and we’ll treat it as a Word. We’ll build this pattern next.</p>
<p><a href="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_6.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="229" alt="image" src="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_thumb_6.png" width="491" border="0" /></a> </p>
</p>
<h3>Finishing the pickCommand</h3>
<p>Below a few things have been done:</p>
<ul>
<li>Added another example command </li>
<li>Defined <em><strong>Word </strong></em>and added it to our pickCommand syntax </li>
<li>Indicated in Main that commands can be 1 or more with the <em><strong>+</strong></em> sign </li>
</ul>
<p>Our grammar compiles, the example commands process and the parsed results appear in the PreviewMode on the right.</p>
<p><a href="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_7.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="232" alt="image" src="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_thumb_7.png" width="497" border="0" /></a> </p>
<h3>The Full Robot Grammar</h3>
<p><a href="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_8.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="297" alt="image" src="http://dougfinke.com/uploadPictures/BuildingParsersinM_8627/image_thumb_8.png" width="498" border="0" /></a> </p>
<h3>Next Steps</h3>
<p>This is just scratching the surface. Both Intellipad and MGrammar have far more to explore. Intellipad is highly customizable. Its use of IronPython is just one way to extend it. MGrammar also supports modularity, advanced grammar techniques, including parameterization and recursion and custom projections.</p>
<p>Next we need to use the language in a .Net application. This requires the <strong><em>mgx</em></strong> compiler, and new namespaces, System.Dataflow and Microsoft.M.Grammar.</p>
<h3>Source for Robot Grammar</h3>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">module RobotLibrary</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    language Robot</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    {        </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        syntax command </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            = pickCommand </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            | placeCommand </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            | scanCommand;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        syntax pickCommand </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            = <span style="color: #006080">&quot;pick&quot;</span> <span style="color: #006080">&quot;carrier&quot;</span> <span style="color: #006080">&quot;from&quot;</span> Word;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        syntax placeCommand </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            = <span style="color: #006080">&quot;place&quot;</span> <span style="color: #006080">&quot;carrier&quot;</span> <span style="color: #006080">&quot;at&quot;</span> Word;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        syntax scanCommand </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            = <span style="color: #006080">&quot;scan&quot;</span> Word;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        token Word = (<span style="color: #006080">'A'</span>..<span style="color: #006080">'Z'</span> | <span style="color: #006080">'a'</span>..<span style="color: #006080">'z'</span>)+;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        syntax Main = command+;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        interleave Whitespace = <span style="color: #006080">&quot; &quot;</span> | <span style="color: #006080">&quot;\r&quot;</span> | <span style="color: #006080">&quot;\n&quot;</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}</pre>
</p></div>
</div>
<p>Resources</p>
<ul>
<li><a href="http://blogs.gotdotnet.com/intellipad/default.aspx">Intellipad Team Blog</a> </li>
<li><a href="http://blogs.msdn.com/mlanguage/default.aspx">&quot;Oslo&quot; Modeling Language Team Blog</a> </li>
<li><a href="http://msdn.microsoft.com/en-us/oslo/cc748654.aspx">Oslo Downloads</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dougfinke.com/blog/index.php/2008/11/02/building-parsers-with-mgrammar-for-net-applications/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
